Skip to content

Conversation

@TheSpaceGod
Copy link

Fixes cURL Error 26 (SSE Size Mismatch) in Nextcloud Context Chat.

When SSE is enabled, fstat() on a file handle returns the encrypted size, while reading the stream returns the decrypted content. This mismatch caused uploads to fail with cURL error 26 because Guzzle uses fstat to calculate the request Content-Length.

This fix:

  1. Explicitly passes the decrypted file size (obtained via $file->getSize()) to the Source object.
  2. In LangRopeService, wraps the file stream in a Guzzle FnStream and overrides getSize() to return the correct decrypted size. This forces Guzzle to advertise the correct length, matching the data streamed.

Includes comprehensive reproduction scripts validating the fix against Nextcloud VFS encryption.

Test output before on commit: [f7c85cd]

nextcloud_context_chat/tests/reproduction on  fix-sse-size-mismatch-15094702859884413816 via 🐘 v8.5.2 via 🐍 v3.14.2 
❯ ./run_test.sh 
WARN[0000] No services to build                         
[+] up 2/2
 ✔ Container reproduction-context_chat_backend-1 Created                                                                                                0.2s 
 ✔ Container reproduction-nextcloud-1            Created                                                                                                0.2s 
Waiting for container to accept commands...
Checking Nextcloud status...
Nextcloud is not installed - only a limited number of commands are available
Nextcloud is not installed. Installing...
Nextcloud was successfully installed
Waiting for Nextcloud to be fully ready...
Nextcloud is ready.
Configuring Nextcloud...
encryption 2.20.0 enabled
Encryption enabled

Default module: OC_DEFAULT_MODULE
Master key already enabled
context_chat 5.2.0 enabled
app_api already enabled
Cleaning up previous registrations...
ExApp context_chat_backend not found. Failed to unregister.
Daemon config manual_install not found.
Registering Mock Backend...
Daemon successfully registered.
ExApp context_chat_backend deployed successfully.
ExApp context_chat_backend successfully registered.
Enabling Context Chat Backend...
ExApp context_chat_backend already enabled.
Listing AppAPI apps...
ExApps:
context_chat_backend (Context Chat Backend): 1.0.0 [enabled]
Config value 'backend_init' for app 'context_chat' is now set to 'true', stored as mixed in fast cache
Creating test file via VFS (Encrypted)...
[+] copy 1/1
 ✔ reproduction-nextcloud-1 Copied create_test_file.php to reproduction-nextcloud-1:/var/www/html/create_test_file.php                                  0.0s 
Created encrypted test.txt successfully.
Verifying file existence in Nextcloud VFS...
SUCCESS: test.txt found in Nextcloud VFS.
DEBUG: Checking file sizes...
[+] copy 1/1
 ✔ reproduction-nextcloud-1 Copied debug_sizes.php to reproduction-nextcloud-1:/var/www/html/debug_sizes.php                                            0.0s 
File::getSize() for test.txt: 1048576
fstat()['size'] for test.txt: 1069248
Actual Read Size for test.txt: 1048576
Mismatch for test.txt: 0
File::getSize() for Nextcloud Manual.pdf: 22209301
fstat()['size'] for Nextcloud Manual.pdf: 22209301
Actual Read Size for Nextcloud Manual.pdf: 22209301
Mismatch for Nextcloud Manual.pdf: 0
Running Scan (Direct Indexing) on test.txt...

In LangRopeService.php line 132:
                                                                                                                                                            
  Error during request to Context Chat Backend (ExApp): cURL error 26: client read function EOF fail, only 1048919/1069591 of needed bytes read (see https  
  ://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://context_chat_backend:23000/loadSources                                                          
                                                                                                                                                            

context_chat:scan [-m|--mimetype MIMETYPE] [-d|--directory DIRECTORY] [--] <user_id>


nextcloud_context_chat/tests/reproduction on  fix-sse-size-mismatch-15094702859884413816 via 🐘 v8.5.2 via 🐍 v3.14.2 took 38s 
❯ 

Test output after on commit: [f7c85cd]

nextcloud_context_chat/tests/reproduction on  fix-sse-size-mismatch-15094702859884413816 via 🐘 v8.5.2 via 🐍 v3.14.2 
❯ ./run_test.sh 
WARN[0000] No services to build                         
[+] up 2/2
 ✔ Container reproduction-nextcloud-1            Created                                                                                                0.3s 
 ✔ Container reproduction-context_chat_backend-1 Created                                                                                                0.3s 
Waiting for container to accept commands...
Checking Nextcloud status...
Nextcloud is not installed - only a limited number of commands are available
Nextcloud is not installed. Installing...
Nextcloud was successfully installed
Waiting for Nextcloud to be fully ready...
Nextcloud is ready.
Configuring Nextcloud...
encryption 2.20.0 enabled
Encryption enabled

Default module: OC_DEFAULT_MODULE
Master key already enabled
context_chat 5.2.0 enabled
app_api already enabled
Cleaning up previous registrations...
ExApp context_chat_backend not found. Failed to unregister.
Daemon config manual_install not found.
Registering Mock Backend...
Daemon successfully registered.
ExApp context_chat_backend deployed successfully.
ExApp context_chat_backend successfully registered.
Enabling Context Chat Backend...
ExApp context_chat_backend already enabled.
Listing AppAPI apps...
ExApps:
context_chat_backend (Context Chat Backend): 1.0.0 [enabled]
Config value 'backend_init' for app 'context_chat' is now set to 'true', stored as mixed in fast cache
Creating test file via VFS (Encrypted)...
[+] copy 1/1
 ✔ reproduction-nextcloud-1 Copied create_test_file.php to reproduction-nextcloud-1:/var/www/html/create_test_file.php                                  0.0s 
Created encrypted test.txt successfully.
Verifying file existence in Nextcloud VFS...
SUCCESS: test.txt found in Nextcloud VFS.
DEBUG: Checking file sizes...
[+] copy 1/1
 ✔ reproduction-nextcloud-1 Copied debug_sizes.php to reproduction-nextcloud-1:/var/www/html/debug_sizes.php                                            0.0s 
File::getSize() for test.txt: 1048576
fstat()['size'] for test.txt: 1069248
Actual Read Size for test.txt: 1048576
Mismatch for test.txt: 0
File::getSize() for Nextcloud Manual.pdf: 22209301
fstat()['size'] for Nextcloud Manual.pdf: 22209301
Actual Read Size for Nextcloud Manual.pdf: 22209301
Mismatch for Nextcloud Manual.pdf: 0
Running Scan (Direct Indexing) on test.txt...
[admin] Scanned files/test.txt
Checking backend logs...
Collecting flask
  Downloading flask-3.1.2-py3-none-any.whl (103 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 103.3/103.3 kB 2.4 MB/s eta 0:00:00
Collecting click>=8.1.3
  Downloading click-8.1.8-py3-none-any.whl (98 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 98.2/98.2 kB 3.1 MB/s eta 0:00:00
Collecting importlib-metadata>=3.6.0
  Downloading importlib_metadata-8.7.1-py3-none-any.whl (27 kB)
Collecting itsdangerous>=2.2.0
  Downloading itsdangerous-2.2.0-py3-none-any.whl (16 kB)
Collecting markupsafe>=2.1.1
  Downloading markupsafe-3.0.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (20 kB)
Collecting jinja2>=3.1.2
  Downloading jinja2-3.1.6-py3-none-any.whl (134 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 134.9/134.9 kB 10.5 MB/s eta 0:00:00
Collecting werkzeug>=3.1.0
  Downloading werkzeug-3.1.5-py3-none-any.whl (225 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 225.0/225.0 kB 6.6 MB/s eta 0:00:00
Collecting blinker>=1.9.0
  Downloading blinker-1.9.0-py3-none-any.whl (8.5 kB)
Collecting zipp>=3.20
  Downloading zipp-3.23.0-py3-none-any.whl (10 kB)
Installing collected packages: zipp, markupsafe, itsdangerous, click, blinker, werkzeug, jinja2, importlib-metadata, flask
Successfully installed blinker-1.9.0 click-8.1.8 flask-3.1.2 importlib-metadata-8.7.1 itsdangerous-2.2.0 jinja2-3.1.6 markupsafe-3.0.3 werkzeug-3.1.5 zipp-3.23.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

[notice] A new release of pip is available: 23.0.1 -> 26.0.1
[notice] To update, run: pip install --upgrade pip
 * Serving Flask app 'mock_server'
 * Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on all addresses (0.0.0.0)
 * Running on http://127.0.0.1:23000
 * Running on http://172.18.0.3:23000
Press CTRL+C to quit
172.18.0.2 - - [07/Feb/2026 00:02:16] "GET /heartbeat HTTP/1.1" 200 -
172.18.0.2 - - [07/Feb/2026 00:02:16] "POST /init HTTP/1.1" 404 -
172.18.0.2 - - [07/Feb/2026 00:02:16] "GET /heartbeat HTTP/1.1" 200 -
172.18.0.2 - - [07/Feb/2026 00:02:16] "PUT /enabled?enabled=1 HTTP/1.1" 404 -
172.18.0.2 - - [07/Feb/2026 00:02:25] "PUT /loadSources HTTP/1.1" 200 -
Test completed successfully.

nextcloud_context_chat/tests/reproduction on  fix-sse-size-mismatch-15094702859884413816 via 🐘 v8.5.2 via 🐍 v3.14.2 took 38s 
❯ 

google-labs-jules bot and others added 30 commits February 5, 2026 01:40
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `LangRopeService` to use the `$size` property for the `Content-Length` header in the API request, overriding the auto-detection which uses `fstat` (returning encrypted size).
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added reproduction scripts in `tests/reproduction/`.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `LangRopeService` to use the `$size` property for the `Content-Length` header in the API request, overriding the auto-detection which uses `fstat` (returning encrypted size).
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added reproduction scripts in `tests/reproduction/`.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `LangRopeService` to use the `$size` property for the `Content-Length` header in the API request, overriding the auto-detection which uses `fstat` (returning encrypted size).
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added reproduction scripts in `tests/reproduction/`.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `LangRopeService` to use the `$size` property for the `Content-Length` header in the API request, overriding the auto-detection which uses `fstat` (returning encrypted size).
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added reproduction scripts in `tests/reproduction/`.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `ScanService` to pass the logical file size to the `Source` during manual scans.
- Updated `LangRopeService` to use the `$size` property for the `Content-Length` header in the API request, overriding the auto-detection which uses `fstat` (returning encrypted size).
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added reproduction scripts in `tests/reproduction/`.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `ScanService` to pass the logical file size to the `Source` during manual scans.
- Updated `LangRopeService` to use the `$size` property for the `Content-Length` header in the API request, overriding the auto-detection which uses `fstat` (returning encrypted size).
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added reproduction scripts in `tests/reproduction/`.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `ScanService` to pass the logical file size to the `Source` during manual scans.
- Updated `LangRopeService` to use the `$size` property for the `Content-Length` header in the API request, overriding the auto-detection which uses `fstat` (returning encrypted size).
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added reproduction scripts in `tests/reproduction/`.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `ScanService` to pass the logical file size to the `Source` during manual scans.
- Updated `LangRopeService` to use the `$size` property for the `Content-Length` header in the API request, overriding the auto-detection which uses `fstat` (returning encrypted size).
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added reproduction scripts in `tests/reproduction/`.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `ScanService` to pass the logical file size to the `Source` during manual scans.
- Updated `LangRopeService` to use the `$size` property for the `Content-Length` header in the API request, overriding the auto-detection which uses `fstat` (returning encrypted size).
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added reproduction scripts in `tests/reproduction/`.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `ScanService` to pass the logical file size to the `Source` during manual scans.
- Updated `LangRopeService` to use the `$size` property for the `Content-Length` header in the API request, overriding the auto-detection which uses `fstat` (returning encrypted size).
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added reproduction scripts in `tests/reproduction/`.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `ScanService` to pass the logical file size to the `Source` during manual scans.
- Updated `LangRopeService` to use the `$size` property for the `Content-Length` header in the API request, overriding the auto-detection which uses `fstat` (returning encrypted size).
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added reproduction scripts in `tests/reproduction/`.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `ScanService` to pass the logical file size to the `Source` during manual scans.
- Updated `LangRopeService` to use the `$size` property for the `Content-Length` header in the API request, overriding the auto-detection which uses `fstat` (returning encrypted size).
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added reproduction scripts in `tests/reproduction/`.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `ScanService` to pass the logical file size to the `Source` during manual scans.
- Updated `LangRopeService` to use the `$size` property for the `Content-Length` header in the API request, overriding the auto-detection which uses `fstat` (returning encrypted size). Casts size to string to satisfy Guzzle requirements.
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added reproduction scripts in `tests/reproduction/`.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `ScanService` to pass the logical file size to the `Source` during manual scans.
- Updated `LangRopeService` to use the `$size` property for the `Content-Length` header in the API request, overriding the auto-detection which uses `fstat` (returning encrypted size). Casts size to string to satisfy Guzzle requirements.
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added reproduction scripts in `tests/reproduction/`.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `ScanService` to pass the logical file size to the `Source` during manual scans.
- Updated `LangRopeService` to use the `$size` property for the `Content-Length` header in the API request, overriding the auto-detection which uses `fstat` (returning encrypted size). Casts size to string to satisfy Guzzle requirements.
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added reproduction scripts in `tests/reproduction/`.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `ScanService` to pass the logical file size to the `Source` during manual scans.
- Updated `LangRopeService` to use the `$size` property for the `Content-Length` header in the API request, overriding the auto-detection which uses `fstat` (returning encrypted size). Casts size to string to satisfy Guzzle requirements.
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added reproduction scripts in `tests/reproduction/`.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `ScanService` to pass the logical file size to the `Source` during manual scans.
- Updated `LangRopeService` to use the `$size` property for the `Content-Length` header in the API request, overriding the auto-detection which uses `fstat` (returning encrypted size). Casts size to string to satisfy Guzzle requirements.
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added reproduction scripts in `tests/reproduction/`.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `ScanService` to pass the logical file size to the `Source` during manual scans.
- Updated `LangRopeService` to use the `$size` property for the `Content-Length` header in the API request, overriding the auto-detection which uses `fstat` (returning encrypted size). Casts size to string to satisfy Guzzle requirements.
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added reproduction scripts in `tests/reproduction/`.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `ScanService` to pass the logical file size to the `Source` during manual scans.
- Updated `LangRopeService` to use the `$size` property for the `Content-Length` header in the API request, overriding the auto-detection which uses `fstat` (returning encrypted size). Casts size to string to satisfy Guzzle requirements.
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added reproduction scripts in `tests/reproduction/`.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `ScanService` to pass the logical file size to the `Source` during manual scans.
- Updated `LangRopeService` to use the `$size` property for the `Content-Length` header in the API request, overriding the auto-detection which uses `fstat` (returning encrypted size). Casts size to string to satisfy Guzzle requirements.
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added reproduction scripts in `tests/reproduction/`.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `ScanService` to pass the logical file size to the `Source` during manual scans.
- Updated `LangRopeService` to use the `$size` property for the `Content-Length` header in the API request, overriding the auto-detection which uses `fstat` (returning encrypted size). Casts size to string to satisfy Guzzle requirements.
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added reproduction scripts in `tests/reproduction/`.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `ScanService` to pass the logical file size to the `Source` during manual scans.
- Updated `LangRopeService` to use the `$size` property for the `Content-Length` header in the API request, overriding the auto-detection which uses `fstat` (returning encrypted size). Casts size to string to satisfy Guzzle requirements.
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added reproduction scripts in `tests/reproduction/`.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `ScanService` to pass the logical file size to the `Source` during manual scans.
- Updated `LangRopeService` to use the `$size` property for the `Content-Length` header in the API request, overriding the auto-detection which uses `fstat` (returning encrypted size). Casts size to string to satisfy Guzzle requirements.
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added reproduction scripts in `tests/reproduction/`.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `ScanService` to pass the logical file size to the `Source` during manual scans.
- Updated `LangRopeService` to use the `$size` property for the `Content-Length` header in the API request, overriding the auto-detection which uses `fstat` (returning encrypted size). Casts size to string to satisfy Guzzle requirements.
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added reproduction scripts in `tests/reproduction/` including `debug_sizes.php`.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `ScanService` to pass the logical file size to the `Source` during manual scans.
- Updated `LangRopeService` to use the `$size` property for the `Content-Length` header in the API request, overriding the auto-detection which uses `fstat` (returning encrypted size). Casts size to string to satisfy Guzzle requirements.
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added reproduction scripts in `tests/reproduction/`.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `ScanService` to pass the logical file size to the `Source` during manual scans.
- Updated `LangRopeService` to use the `$size` property for the `Content-Length` header in the API request, overriding the auto-detection which uses `fstat` (returning encrypted size). Casts size to string to satisfy Guzzle requirements.
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added reproduction scripts in `tests/reproduction/` including extensive size debugging tools.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `ScanService` to pass the logical file size to the `Source` during manual scans, and correctly handle single file inputs.
- Updated `LangRopeService` to use the `$size` property for the `Content-Length` header in the API request, overriding the auto-detection which uses `fstat` (returning encrypted size). Casts size to string to satisfy Guzzle requirements.
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added reproduction scripts in `tests/reproduction/`.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `ScanService` to pass the logical file size to the `Source` during manual scans, and correctly handle single file inputs.
- Updated `LangRopeService` to wrap the content stream in a Guzzle `FnStream` and override the `getSize()` method to return the logical size. This ensures Guzzle calculates the correct `Content-Length` for the multipart request body, preventing `cURL error 26` (EOF fail) caused by `fstat` returning the encrypted size.
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added robust reproduction scripts in `tests/reproduction/` including encryption verification and size debugging.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `ScanService` to pass the logical file size to the `Source` during manual scans, and correctly handle single file inputs.
- Updated `LangRopeService` to wrap the content stream in a Guzzle `FnStream` and override the `getSize()` method to return the logical size. This ensures Guzzle calculates the correct `Content-Length` for the multipart request body, preventing `cURL error 26` (EOF fail) caused by `fstat` returning the encrypted size.
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added robust reproduction scripts in `tests/reproduction/` including encryption verification and size debugging.

Co-authored-by: TheSpaceGod <[email protected]>
This commit fixes a bug where uploading files with Server-Side Encryption (SSE) enabled failed due to a size mismatch between the decrypted stream and the physical file size.

Changes:
- Modified `Source` class to accept an optional `$size` property.
- Updated `IndexerJob` to pass the logical (decrypted) file size to the `Source`.
- Updated `ScanService` to pass the logical file size to the `Source` during manual scans, and correctly handle single file inputs.
- Updated `LangRopeService` to wrap the content stream in a Guzzle `FnStream` and override the `getSize()` method to return the logical size. This ensures Guzzle calculates the correct `Content-Length` for the multipart request body, preventing `cURL error 26` (EOF fail) caused by `fstat` returning the encrypted size.
- Added `getAppApiFunctions` to `LangRopeService` to facilitate testing.
- Added unit tests in `tests/unit/Service/LangRopeServiceTest.php` to verify the fix.
- Added robust reproduction scripts in `tests/reproduction/` including encryption verification and size debugging.

Co-authored-by: TheSpaceGod <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant