Skip to content

fix(metadata): write raw-DEFLATE appData (phase 2 of format convergence)#93

Merged
insipx merged 1 commit into
mainfrom
insipx/raw-deflate-writer
Jul 7, 2026
Merged

fix(metadata): write raw-DEFLATE appData (phase 2 of format convergence)#93
insipx merged 1 commit into
mainfrom
insipx/raw-deflate-writer

Conversation

@insipx

@insipx insipx commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Phase 2 of the appData compression-format convergence (phase 1: #91). compressIfSmaller now emits raw DEFLATE (deflateRawSync) — the format iOS (COMPRESSION_ZLIB) and Android (Deflater(nowrap=true)) have always written and are the only format old installed apps can read natively.

  • Writer: deflateSyncdeflateRawSync; frame ([0x1f][size BE4]) unchanged.
  • Reader try-order flipped to raw-first (canonical) with zlib fallback for historic blobs written before this flip; error precedence follows.
  • Tests: new assertions that compressed output raw-inflates directly (what a raw-only reader does) and that a hand-built legacy zlib blob still parses. 499 passed.
  • Pre-existing typecheck errors on main (serve.ts, send-attachment.ts{} vs boolean) are untouched by this diff (metadata.ts + test only).

Rollout gate — met

Requires every server-side reader to have the #91 dual reader before merge:

  • herald + hermes prod are on convos-cli@0.10.13 (verified: prod herald running convos-assistants 97e5749, which pins 0.10.13) ✅
  • iOS/Android installed apps read raw natively — no app-release dependency; their merged zlib-fallback readers cover historic blobs in upcoming releases.

Draft until Andrew confirms merge timing. After this releases + the pin bump, the fleet writes one format and the zlib path becomes read-only legacy.

🤖 Generated with Claude Code


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Note

Write appData compressed bodies as raw DEFLATE with zlib fallback reader

  • Changes compressIfSmaller in metadata.ts to use deflateRawSync instead of deflateSync, so new compressed blobs use raw DEFLATE framing rather than zlib-wrapped DEFLATE.
  • Updates decompressIfNeeded to try inflateRawSync first and fall back to inflateSync for historic zlib-wrapped blobs, surfacing the raw-inflate error if both fail.
  • Adds tests verifying the new writer emits raw DEFLATE and that the reader still accepts legacy zlib blobs.
  • Behavioral Change: existing zlib-wrapped blobs remain readable, but all newly written compressed bodies change wire format.

Macroscope summarized b343767.

@insipx insipx marked this pull request as ready for review July 7, 2026 17:02
@macroscopeapp

macroscopeapp Bot commented Jul 7, 2026

Copy link
Copy Markdown

Approvability

Verdict: Approved

Format convergence change switching compression output from zlib-wrapped to raw DEFLATE to match iOS/Android. Backward compatible (dual-format reader remains), well-tested, and authored by the same person who implemented phase 1 of this convergence.

You can customize Macroscope's approvability policy. Learn more.

@insipx insipx merged commit fcb4ce1 into main Jul 7, 2026
4 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 7, 2026
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