Check the backup payload against the published vector #145

Merged
paulhitt merged 1 commits from test/backup-payload-vector into main 2026-09-10 23:50:48 +00:00
paulhitt commented 2026-09-10 23:43:44 +00:00 (Migrated from gitlab.com)

Both apps were taught one backup shape and nothing checked that they agreed. Each side's tests asserted against what the other was believed to write, transcribed by hand from reading its source, which tests one person's reading rather than interoperability.

backup-payload-v1.json in flamenet-e2e is now the authority, and the bar is exact: decode the canonical payload, encode it again, compare byte for byte once both are in a canonical order. The same vector is checked on the iPhone, so the two are compared against one file rather than against each other's source.

One real fix came out of writing it. messageFromShared wrote author unconditionally, so a one-to-one message carrying no author came back claiming user zero sent it, and a round trip through this app changed the file. Storage keeps an author on every message and reads a missing one as 0, so it is now written only when the file carried one.

The env var is exported in both CI jobs (the pinned one and the one running at vectors HEAD) and added to the gate that checks every vector file exists before the suite runs, since a path that silently does not exist reads as a protocol bug rather than a missing file. .e2e-ref moves to the commit adding the vector.

Depends on flamenet-e2e!38 (merged).

Full suite: 1279 tests, 0 failures. ci/lint accepts the pipeline.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com

Both apps were taught one backup shape and nothing checked that they agreed. Each side's tests asserted against what the *other* was believed to write, transcribed by hand from reading its source, which tests one person's reading rather than interoperability. `backup-payload-v1.json` in flamenet-e2e is now the authority, and the bar is exact: decode the canonical payload, encode it again, compare byte for byte once both are in a canonical order. The same vector is checked on the iPhone, so the two are compared against one file rather than against each other's source. **One real fix came out of writing it.** `messageFromShared` wrote `author` unconditionally, so a one-to-one message carrying no author came back claiming user zero sent it, and a round trip through this app changed the file. Storage keeps an author on every message and reads a missing one as 0, so it is now written only when the file carried one. The env var is exported in **both** CI jobs (the pinned one and the one running at vectors HEAD) and added to the gate that checks every vector file exists before the suite runs, since a path that silently does not exist reads as a protocol bug rather than a missing file. `.e2e-ref` moves to the commit adding the vector. Depends on flamenet-e2e!38 (merged). Full suite: **1279 tests, 0 failures**. `ci/lint` accepts the pipeline. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
paulhitt commented 2026-09-10 23:50:48 +00:00 (Migrated from gitlab.com)

mentioned in commit 913ceaa923

mentioned in commit 913ceaa9230a2802b22745d5adb8dfeab70e886b
paulhitt (Migrated from gitlab.com) merged commit 913ceaa923 into main 2026-09-10 23:50:48 +00:00
paulhitt commented 2026-09-11 00:23:17 +00:00 (Migrated from gitlab.com)

mentioned in merge request !119

mentioned in merge request !119
Sign in to join this conversation.