Mac slice F task 4 fix 1: isolate the upload guard in the contract
Without A's row, B's upload for A's publication is refused by the publication-runner check alone, not by the collision with A's row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+5
−1
internal/thintest/mac_publication_contract_test.go+5 −1
diff --git a/internal/thintest/mac_publication_contract_test.go b/internal/thintest/mac_publication_contract_test.go| index b787a996..1238b75a 100644 |
| --- a/internal/thintest/mac_publication_contract_test.go |
| +++ b/internal/thintest/mac_publication_contract_test.go |
| @@ -279,10 +279,14 @@ func TestContractPublicationBoundToItsPrimary(t *testing.T) { |
| if s := r.task(task).Steps[0]; s.Publication != wire.PublicationFailed || s.Pushed || r.needsYou(task) != wire.NeedsRetry { |
| t.Fatalf("A's publication after B took over: %+v needs %q", s, r.needsYou(task)) |
| } |
| - // Each guard on its own: A's publication as if it were still pending. |
| + // Each guard on its own: A's publication as if it were still pending, |
| + // and without A's row (which a different uploader collides with). |
| if _, err := r.inst.DB.Writer().Exec("UPDATE chat_steps SET publication = ? WHERE id = ?", wire.PublicationPending, d.StepID); err != nil { |
| t.Fatal(err) |
| } |
| + if _, err := r.inst.DB.Writer().Exec("DELETE FROM chat_change_diffs WHERE step_id = ?", d.StepID); err != nil { |
| + t.Fatal(err) |
| + } |
| b.send(wire.FrameChangeDiff, publicationDiff(pub, base, swipeDiff)) |
| if n := r.diffRowsBy(d.StepID, bID); n != 0 { |
| t.Fatalf("B's upload for A's publication: %d rows", n) |