fix(02-03): mask collection_key and checkpoint in JSON diffs

Album sync payloads hash the collection and stamp a checkpoint that
change across seed runs and must not fail PHP self-replay.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jakub Zych
2026-09-17 13:03:38 +02:00
parent 4c1259aafd
commit 0307510b22
2 changed files with 16 additions and 1 deletions

View File

@@ -20,6 +20,11 @@ func TestNormalizeDateIDAndDisable(t *testing.T) {
if diffs := compareBodies(Response{Headers: jsonCT(), Body: Body(nullID)}, Response{Headers: jsonCT(), Body: Body(nullID)}, step); len(diffs) != 0 {
t.Fatalf("null *_id must pass: %+v", diffs)
}
syncA := []byte(`{"collection_key":"aaa","checkpoint":"2026-01-01T00:00:00+00:00","total_estimate":0}`)
syncB := []byte(`{"collection_key":"bbb","checkpoint":"2026-02-02T00:00:00+00:00","total_estimate":0}`)
if diffs := compareBodies(Response{Headers: jsonCT(), Body: Body(syncA)}, Response{Headers: jsonCT(), Body: Body(syncB)}, step); len(diffs) != 0 {
t.Fatalf("collection_key/checkpoint must mask: %+v", diffs)
}
zdiffs := compareBodies(Response{Headers: jsonCT(), Body: Body(want)}, Response{Headers: jsonCT(), Body: Body(gotZ)}, step)
if len(zdiffs) == 0 {
t.Fatal("Z date must fail")