Files
buzz/mobile/lib/shared/relay
Tom Brow 5e36d65c9e fix(mobile): inflate gzip read-state snapshot responses (#9089)
On relays behind a CDN that gzips responses (the Builderlab relay does),
mobile read state never synced. Every read-state snapshot fetch, and
therefore every read-mark publish, failed with `FormatException:
Unexpected extension byte`, so read marks made on the phone never
reached other devices and each reconnect retried and failed again.

The relay query transport deliberately leaves gzip bodies compressed so
they can be inflated off the UI isolate (see `RelayHttpQueryClient`),
but the snapshot path decoded the raw bytes with `utf8.decode`. It now
uses `relayResponseText`, like the other query callers, for both the
discovery and the snapshot responses.

Heads-up for reviewers: with the snapshot working, a resume also pays
for the full snapshot download on top of the existing read-state replay
on the live subscription. A follow-up PR removes that replay.

### Validation

- Added test: `inflates gzip discovery and snapshot bodies` serves both
responses gzipped. Without the fix it fails with the same `Unexpected
extension byte` error seen on the device.
- Full mobile suite: all pass except the known stale
`fullscreen_onboarding_test` case, which fails on main too.
- iPhone 12 mini (Profile build, Builderlab community): before, every
resume logged `snapshot failed` and `publish failed (journal retained)`.
After, the snapshot on resume and the snapshot inside a publish both
completed with no errors.
- Automated app run on the same phone with this change: Home
backgrounded past the reconnect grace period and resumed, then search
and a large channel opened. No read-state errors logged. Read marks were
not compared across devices.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Tom Brow <tomb@squareup.com>
Co-authored-by: Tom Brow <tomb@squareup.com>
Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz>
2026-11-05 11:14:39 -08:00
..