Skip to content

Conversation

@sendya
Copy link
Member

@sendya sendya commented Jan 14, 2026

This pull request introduces improvements to the caching logic and expands the mock server's test endpoints. The most significant changes are related to better handling of incomplete chunked uploads and the addition of a new endpoint for testing chunked responses.

Caching logic improvements:

  • Updated the flushbufferSlice function in caching.go to discard incomplete chunked file uploads by calling DiscardWithMessage if the end of file (eof) is not reached and the response is chunked. This helps prevent storing incomplete or corrupted cache entries.

Testing enhancements:

  • Added a /chunked endpoint to the mock server in main.go that serves data using a rate-limited reader, enabling more robust testing of chunked transfer encoding scenarios.

…that read are not at EOF, drop index metadata.
Copilot AI review requested due to automatic review settings January 14, 2026 03:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request improves caching reliability by preventing incomplete chunked file uploads from being cached and adds a test endpoint for chunked transfer testing.

Changes:

  • Added discard logic for incomplete chunked transfers to prevent corrupted cache entries
  • Introduced a /chunked endpoint in the mock server for testing chunked response handling

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
server/middleware/caching/caching.go Added logic to detect and discard incomplete chunked file uploads when EOF is not reached
tests/mockserver/main.go Added /chunked endpoint with rate-limited reader to enable testing of chunked transfer scenarios

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sendya sendya merged commit ae9c202 into main Jan 14, 2026
7 checks passed
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.

2 participants