fix(docnotify): align E1A fixture aggregate versions with claim gap rule

Per-doc aggregates must use version 1 (not i+1 / 99) or ClaimLeases
skips them under event_consumer_checkpoints head+1 gating.
This commit is contained in:
weichen
2026-09-24 00:49:40 +00:00
parent 134f7864fa
commit c51fb5e22f
+5 -2
View File
@@ -142,7 +142,10 @@ func TestE1A_NotifyFixtureThirtyAuthzAndRollbackTx_PG(t *testing.T) {
for i := 0; i < nFix; i++ {
docID := fmt.Sprintf("e1a30_%s_%d", suffix, i)
seedDoc(t, ctx, pool, docID, projectID, userID)
env := approvedEnv(fmt.Sprintf("%s-%d", suffix, i), docID, projectID, int64(i+1))
// Each doc is its own aggregate; version must start at 1 (or 0) so the
// consumer checkpoint gap rule does not block siblings (version i+1
// would only be claimable after head reaches i on the SAME aggregate).
env := approvedEnv(fmt.Sprintf("%s-%d", suffix, i), docID, projectID, 1)
appendEnv(t, ctx, pool, env, []string{events.ConsumerNotify})
ids = append(ids, env.EventID)
}
@@ -222,7 +225,7 @@ func TestE1A_NotifyFixtureThirtyAuthzAndRollbackTx_PG(t *testing.T) {
}
// same-tx rollback: handle+ack then rollback leaves no extra row
missingDoc := approvedEnv("missing-"+suffix, "no-such-doc-"+suffix, projectID, 99)
missingDoc := approvedEnv("missing-"+suffix, "no-such-doc-"+suffix, projectID, 1)
appendEnv(t, ctx, pool, missingDoc, []string{events.ConsumerNotify})
if _, err := d.RunOnce(ctx, events.ConsumerNotify); err != nil {
t.Fatal(err)