Skip to content

Conversation

@TheSpaceGod
Copy link
Owner

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.
This fix explicitly passes the decrypted file size (obtained via $file->getSize()) to the Source object and uses it to set the Content-Length header in the HTTP request, bypassing the incorrect auto-detection.

Also includes reproduction scripts and unit tests.


PR created automatically by Jules for task 15094702859884413816 started by @TheSpaceGod

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]>
@google-labs-jules
Copy link

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules bot and others added 28 commits February 5, 2026 19:34
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