Skip to content

fix: gzip encoded - force deflate#180

Closed
kptdobe wants to merge 1 commit into
mainfrom
gzip
Closed

fix: gzip encoded - force deflate#180
kptdobe wants to merge 1 commit into
mainfrom
gzip

Conversation

@kptdobe

@kptdobe kptdobe commented Oct 7, 2025

Copy link
Copy Markdown
Contributor

This PR is a part of the fix for wrongly encoded files in R2:

During the bucket migration (from @auniverseaway to Franklin-dev) and for an unknown reason (wrong cache headers ?), some documents got wrongly encoded in the destination bucket - documents are gzip encoded with the source content type.

This cause a weird issue: not sure what happens in production, but when running locally, the worker hangs forever when reading the S3 client response body and is then completely unreachable - it has to be reloaded. I assume in prod, the request just times out. Consequence: empty page in authoring and content is never written to the file.

This PR addresses the GET problem. But it is not enough because the write crashes then (Failed to update document Error: 411 - Length Required in da-collab). Probably a similar trick could be found.

But I will not investigate further. I'll just make a console.warn to detect the corrupted documents and from time to time, run a script to clean up the few remaining corrupted files (script here: https://github.com/kptdobe/da-magic/blob/main/encoding/fix-s3-document-encoding.sh).

@kptdobe kptdobe closed this Oct 7, 2025
@codecov

codecov Bot commented Oct 7, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.92308% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/storage/object/get.js 76.92% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

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