Skip to content

Test the production Android backup archive writer - #2773

Open
kavemang wants to merge 2 commits into
ryanbr:mainfrom
kavemang:agent/android-backup-production-writer-tests-2708
Open

kavemang wants to merge 2 commits into
ryanbr:mainfrom
kavemang:agent/android-backup-production-writer-tests-2708

Conversation

@kavemang

@kavemang kavemang commented Oct 11, 2026 •

Copy link
Copy Markdown

What this PR does

BackupSettingsCodecTest exercised a duplicate ZIP writer that no production export called. Route Android exportTo through the context-free stream writer and test the same archive construction used at runtime.

The copy stays inside the existing Room write transaction and output-stream scope. The writer returns the copied database byte count used for restore-ceiling warnings, preserves database/settings/manifest entry order, and finishes the ZIP before verification. Tests cover exact UTF-8 manifest/settings payloads, a readable central directory, database-only byte accounting, legacy and manifest-only shapes, restore round-trips, and propagated output failures with cleanup.

Android-only JVM/SAF extraction: the container entries, settings whitelist, provenance payload and database schema are unchanged; no Swift storage or analytics change is needed. Required derived parity metadata accompanies the production call-graph change.

Type of change

  • Refactor / cleanup

How it was tested

  • Focused Linux JVM harness: all 12 committed BackupSettingsCodecTest methods and the changed BackupSyncFileIoTest archive round-trip pass against extracted production writer/staging/codec code, real ZIP/file I/O and JSON, with verbatim production entry-name and hosted-card constants. This does not compile Android Context/Room/SAF or exercise a live database transaction.
  • Private manifest-payload mutation is rejected by the new exact payload assertion; no mutant is committed.
  • Guarded parity refresh passed (289 known findings), core tools passed all 153 tests, and source hygiene, whitespace and diff-scoped translation checks passed. Exact out-of-scope twin registration points to the existing Apple app-layer archive writer.
  • On actual head d1c1abc9ff7644bf63dc418761359ae01f81c17d, Android CI compiled the complete app and built the debug APK (4m 35s), then passed the full testFullDebugUnitTest suite (1m 53s). No warnings name the changed production or test files. Individual JVM test counts are not emitted by this workflow.
  • On that same head, parity governance passed 160 tests; Tools CI passed 234 capture tests, 50 repository-acceptance tests, 2 R-R preservation tests and 153 core tests. All five expected checks passed, including hygiene and translation coverage.
  • No BLE behavior changed or hardware validation claimed. Room snapshot concurrency and real SAF providers were not exercised on a device.

Checklist

  • Android full unit suite and compile pass on current PR head
  • No new build warnings introduced
  • No hardcoded hex frame bytes; protocol facts live in the schema / decoders
  • Follows the conventions in docs/CONTRIBUTING.md
  • No generated output, secrets or signing files committed

Related issues

Refs #2708

@kavemang
kavemang marked this pull request as ready for review October 11, 2026 06:12
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