GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — pm-stack: decision-events Worker loses Durable Object fan-out when ingest fails after the D1 commit (PR #9341 Codex P1) · Issue #9612 · developing-today/code

pm-stack: decision-events Worker loses Durable Object fan-out when ingest fails after the D1 commit (PR #9341 Codex P1) #9612

New issue
Copy link
New issue
Copy link
Closed
#9624
Closed
pm-stack: decision-events Worker loses Durable Object fan-out when ingest fails after the D1 commit (PR #9341 Codex P1)#9612
#9624
Copy link
Assignees
dezren39
Labels
app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/mMedium: expected under 1 day of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/highImportant and time-sensitivesource/pr-comment-reviewFiled by the pr-comment-review jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Description

@dezren39
dezren39
opened on Nov 14, 2026
Issue body actions

Finding (from PR review)

PR #9341 (merged, feat(pm-stack): decision-set event pipeline — Turso sync + Cloudflare Worker/D1/DO (#9335)) adds the decision-events Worker. Codex's P1 finding: pending Durable Object fan-out is lost permanently when ingest fails after the D1 batch commits. The Worker fans out only events whose D1 INSERT OR IGNORE reported changes; if the Durable Object ingest then fails (non-OK response), the handler still returns HTTP 200, the sync client acknowledges the events, and on any retry the D1 inserts report zero changes — so the events are never fanned out to subscribers or the per-set coordination state.

  • Source PR: feat(pm-stack): decision-set event pipeline — Turso sync + Cloudflare Worker/D1/DO (#9335) #9341
  • Review comment: feat(pm-stack): decision-set event pipeline — Turso sync + Cloudflare Worker/D1/DO (#9335) #9341 (comment)
  • Reviewer: chatgpt-codex-connector[bot], 2026-11-13T05:34:08Z (P1)
  • Flagged location: pm-stack/decision-events-worker/src/index.ts:170

"If the Durable Object ingest fails after the D1 batch commits, these events can never reach the object on retry: their next inserts report zero changes, so insertedEvents excludes them permanently. A non-OK ingest response is also converted into an HTTP 200 webhook response, causing the sync client to acknowledge the events despite the failed fan-out. Persist pending fan-out separately and retry it, with event-ID deduplication at the Durable Object, so transient failures do not permanently lose subscriber notifications and coordination state."

No-response evidence

  • The review thread contains only the Codex comment — no replies (verified 2026-11-14 via the PR comments API and a GraphQL reviewThreads read: isResolved=false, 1 comment).
  • PR feat(pm-stack): decision-set event pipeline — Turso sync + Cloudflare Worker/D1/DO (#9335) #9341's only commit after the comment is 66940fb15f (2026-11-13T05:40:26Z), a merge of origin/main into the branch — it does not touch the flagged logic. The PR merged at 2026-11-13T05:45:31Z (merge commit aad1d3602a) with the finding unaddressed; the only later main commit touching these files is a treefmt style pass (d451641c31).
  • Dedupe: open/closed issue searches by comment id, file path, and keywords (fan-out, pagination cursor, outbox-dir, webhook acknowledgement) found no issue covering this finding; parent issue pm-stack decision sets v2: rich questions, event log, submit API + activity webhook/hook #9335 is closed and does not track it.

Still-live evidence (verified 2026-11-14 on current main)

  • pm-stack/decision-events-worker/src/index.ts:160-186: the D1 batch runs first; insertedEvents is built only from rows with meta.changes > 0 (lines 161-167); the fan-out loop (line 170) iterates only insertedEvents; a non-OK ingest is recorded as { error: ... } in the fanout map (line 177) and the handler still returns Response.json({...}) with HTTP 200 (lines 180-186). A retry therefore excludes the already-stored events from fan-out forever.
  • The Durable Object /ingest handler (lines 91-96) increments state.fannedOut and overwrites last-event fields for every event it receives, with no event-ID deduplication — so a retry mechanism also needs the dedup the reviewer asked for.

Acceptance criteria

  • A failed Durable Object ingest no longer loses fan-out: pending fan-out is persisted/retried (or the webhook returns a non-200 the sync client will not acknowledge), and the Durable Object deduplicates by event ID.
  • A regression test covers: D1 commit succeeds, DO ingest fails, retry delivers the events exactly once.
  • Or: a documented decision on this issue that this loss mode is accepted, with the reasoning recorded.

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    priority/highImportant and time-sensitive
    queue/queuedHas a queued queue task
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    source/pr-comment-reviewFiled by the pr-comment-review job
    on Nov 14, 2026
  2. dezren39 commented on Nov 14, 2026

    @dezren39
    dezren39
    on Nov 14, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: pr-comment-review job
    • Session / ID: pr-comment-review run 2026-11-13 19:54 CST (2026-11-14T02:04Z)
    • Found via: unaddressed PR comment, feat(pm-stack): decision-set event pipeline — Turso sync + Cloudflare Worker/D1/DO (#9335) #9341 (comment)
    • Task: Triage the validated unaddressed PR review finding: decision-events Worker loses Durable Object fan-out when ingest fails after the D1 commit
    • Expectation: effort s — triage verifies the finding against current main, then routes a fix or records a documented decision on the issue
    • Links: source comment feat(pm-stack): decision-set event pipeline — Turso sync + Cloudflare Worker/D1/DO (#9335) #9341 (comment)
  3. dezren39 commented on Nov 14, 2026

    @dezren39
    dezren39
    on Nov 14, 2026
    MemberAuthor
    More actions

    Picked up by repo-worker-any-a — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while repo-worker-any-a posts progress markers; after 30 minutes of silence any other worker may pick this up.)

  4. dezren39
    added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    and removed
    queue/queuedHas a queued queue task
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    on Nov 14, 2026
  5. 98 remaining items

  6. dezren39
    added
    queue/queuedHas a queued queue task
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    queue/queuedHas a queued queue task
    on Nov 14, 2026
  7. dezren39 commented on Nov 14, 2026

    @dezren39
    dezren39
    on Nov 14, 2026
    MemberAuthor
    More actions

    agent-note:v1
    worker: repo-worker-code
    lane: code-h
    task_id: 16157
    state: claimed
    note: Picked up small_fix for #9612. Creating worktree and inspecting pm-stack/decision-events-worker.

  8. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 14, 2026
  9. dezren39 commented on Nov 14, 2026

    @dezren39
    dezren39
    on Nov 14, 2026
    MemberAuthor
    More actions

    agent-note:v1
    worker: repo-worker-code
    lane: code-h
    task_id: 16157
    state: done
    note: Opened PR #9624 (#9624) fixing DO fan-out loss on ingest failure and adding eventId deduplication. bun test: 8 pass, 0 fail.

  10. dezren39
    added a commit that references this issue on Nov 17, 2026

    Merge pull request #9624 from developing-today/queue/16157-9612-decis…

    04aa8c2
  11. dezren39
    closed this as completedin #9624on Nov 17, 2026
  12. dezren39 commented on Nov 17, 2026

    @dezren39
    dezren39
    on Nov 17, 2026
    MemberAuthor
    More actions

    state: already_done (re-triage)
    lane: any-b, worker: repo-worker-code, task 19057

    Re-triage of #9612 (2026-11-17): already fixed and closed. Lane code-h verified the defect live on origin/main on 2026-11-14 (tasks 16156/16157) and landed PR #9624 — DO fan-out no longer lost when /ingest fails after the D1 commit, plus eventId deduplication in the Durable Object (bun test: 8 pass, 0 fail, per the closing note). PR merge state re-verified fresh this shift and recorded in the triage result. No further work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/mMedium: expected under 1 day of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/highImportant and time-sensitivesource/pr-comment-reviewFiled by the pr-comment-review jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.