fix: repos with very large entries (e.g. Brave) fail to sync with "Error parsing index"#1338
Open
Victor-root wants to merge 1 commit into
Open
fix: repos with very large entries (e.g. Brave) fail to sync with "Error parsing index"#1338Victor-root wants to merge 1 commit into
Victor-root wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🐛 What's broken
Adding a repository that contains a single very large entry — like the
Brave Browser repos, which bundle hundreds of releases for one package —
fails to sync. The repo shows as added, but you get an
Error parsing indexnotification and never receive its apps.
Root cause: that entry serializes to a > 2 MB blob, and SQLite's per-row
CursorWindowis capped at ~2 MB. Reading the row throwsSQLiteBlobTooBigException— both while merging the downloaded index(
IndexMerger) and when reading the full product from the database(
ProductAdapter).🔧 The fix
Gzip-compress the large serialized blobs before storing them, and decompress
on read. JSON shrinks ~5–10×, which keeps these rows comfortably under the limit.
This can affect any repo with an oversized entry, not just Brave, so the fix
is global.
ByteArray.gzip()/gunzipIfNeeded()helpersIndexMerger(sync/merge path)ROW_DATAinProductAdapter(app-detail path)♻️ Backward compatible
Reads auto-detect the gzip header, so rows written before this change still
parse — no DB migration and no forced re-sync.
🧪 Testing
both Brave Beta repos now sync cleanly