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 — projector(webhook): a delivery that fails to apply can never be retried — its error row makes every redelivery a 'duplicate', and push events are lost permanently · Issue #2456 · developing-today/code

projector(webhook): a delivery that fails to apply can never be retried — its error row makes every redelivery a 'duplicate', and push events are lost permanently #2456

New issue
Copy link
New issue
Copy link
Closed
#4186
Closed
projector(webhook): a delivery that fails to apply can never be retried — its error row makes every redelivery a 'duplicate', and push events are lost permanently#2456
#4186
Copy link
Assignees
dezren39
Labels
app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Description

@dezren39
dezren39
opened on Oct 29, 2026
Issue body actions

Summary

In the PM projector's webhook intake, a delivery whose application fails is permanently dropped — GitHub's redelivery of the same delivery GUID is answered 200 {"status":"duplicate"} and never applied. The idempotency check asks only whether any row exists for the delivery id, but the failure paths record a row too (with outcome: "error"). So one transient failure at apply time (a locked/restarting DB, a mid-migration schema gap, a Turso hiccup) converts a retryable 500 into silent, permanent data loss. For push events the loss is absolute: pushes have no reconciliation stream (reconcile.ts covers issues, PRs, issue comments, review comments, and reviews only), so a dropped push never appears in pmp_push_events. Item/comment events are partially healed by the next reconcile poll — but only when reconcile is enabled and reaches that repo/stream, and the audit row still claims the delivery was handled.

Evidence (main 5a34fa7)

  • pm-stack/projector/src/store.ts:337-343 — deliveryApplied(db, deliveryId) is SELECT 1 FROM pmp_deliveries WHERE delivery_id = ? with no outcome filter: any recorded row, applied or errored, counts as "applied". (The schema comment in schema.sql states the intent as "a redelivered webhook is applied at most once" — the check as written enforces "recorded at most once".)
  • pm-stack/projector/src/server.ts:76-80 — the webhook handler returns 200 {status: "duplicate"} whenever deliveryApplied is true, before parsing or applying.
  • pm-stack/projector/src/server.ts:99 — when applyEvent throws, the handler records the delivery with outcome: "error" and returns 500. GitHub redelivers on 5xx — straight into the duplicate short-circuit above. (The invalid_json error row at :84 has the same effect for its delivery id, harmlessly, since the payload cannot change; the apply-failure row is the harmful one.)

Verified this run with a laptop Bun probe driving the real handleRequest (HMAC-signed push webhook, real store.ts, real libSQL file DB; files md5-identical to main 5a34fa7):

attempt 1 (apply fails):        500 {"error":"apply_failed"}
deliveries row after failure:   [{"delivery_id":"delivery-xyz","outcome":"error"}]
attempt 2 (redelivery, same GUID): 200 {"status":"duplicate"}
push_events rows after redelivery: [{"n":0}]

The transient failure was simulated by dropping pmp_push_events for the first attempt and restoring the schema (via the real migrate) before the redelivery — the exact shape of a mid-deploy/migration hiccup. After the schema was healthy, the redelivery was still refused and the push was never recorded.

Probe: ~/git/fleet/probe-2026-10-29-laneB-projdel/probe2.ts (laptop).

Why it matters

Webhook intake is the projector's live path; reconciliation is explicitly the safety net, not the primary feed, and it does not cover pushes at all. The current code turns the one failure mode redelivery exists for — a transient 5xx — into the one outcome redelivery cannot fix. Worse, the response on redelivery is a success-shaped 200 duplicate, so nothing in GitHub's delivery log or the projector's own responses signals the loss; only the outcome: "error" audit row knows, and nothing reads it.

Acceptance criteria

  • A delivery whose application failed (an outcome: "error" row, or no row) is applied when redelivered with the same delivery GUID; only successfully applied (or genuinely ignored-after-successful-processing) deliveries short-circuit as duplicates.
  • Recording a redelivery attempt does not violate the pmp_deliveries primary key or lose the original error audit (triage pins the shape: e.g. outcome-filtered check + upsert/update on retry, or not recording failures as delivery rows while keeping an error log).
  • Regression tests cover: apply-failure then same-GUID redelivery succeeds and the event's rows exist (push event recorded); successful delivery then same-GUID redelivery still returns duplicate and applies nothing twice; the invalid-JSON path's behaviour is unchanged or explicitly re-pinned by triage.
  • The duplicate response remains 200 for true duplicates (GitHub must not keep retrying those).

Dedup

gh searches (open + closed) for deliveryApplied, "projector delivery", "webhook redeliver": no issue covers failed-delivery retry. #2455 (filed this run) is the projector comments monotonic guard — different mechanism in the same service. #1547 (open) is the read-API limit parameter; #1529 (open) is GitHub App key decoding.

Activity

Next
  1. developing-today commented on Oct 29, 2026

    @developing-today
    developing-todayBot
    on Oct 29, 2026 – with developing.today
    Contributor
    More actions

    CODE-1255

  2. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued queue task
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    effort/xsTrivial: expected under 30 minutes of work
    on Oct 29, 2026
  3. dezren39 commented on Oct 29, 2026

    @dezren39
    dezren39
    on Oct 29, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator-code-b
    • Session / ID: new-issue-creator-code-b cron run 2026-10-29 17:50 CDT
    • Found via: filed this run
    • Task: Filed the projector webhook retry flaw: deliveryApplied (store.ts:337-343) checks only that a pmp_deliveries row exists, but the apply-failure path (server.ts:99) records an outcome:"error" row — so GitHub's redelivery of the same GUID hits the duplicate short-circuit (server.ts:76-80, 200 "duplicate") and is never applied. Push events have no reconcile stream, so their loss is permanent. Verified with a laptop Bun probe through the real handleRequest (main 5a34fa7, md5-identical files): first attempt 500 apply_failed with the push table dropped, schema restored, same-GUID redelivery returned 200 duplicate and pmp_push_events stayed empty.
    • Expectation: effort xs; done when triage pins the fix shape (outcome-filtered duplicate check + retry-safe recording that preserves the error audit) and routes a small_fix packet with the named regression tests.
    • Links: projector(webhook): a delivery that fails to apply can never be retried — its error row makes every redelivery a 'duplicate', and push events are lost permanently #2456 projector(webhook): a delivery that fails to apply can never be retried — its error row makes every redelivery a 'duplicate', and push events are lost permanently #2456 · sibling filed this run projector(comments): a deleted comment is resurrected by any stale upsert — the comments monotonic guard keys on created_at and markCommentDeleted never advances it #2455 (comments guard, different mechanism)
  4. github-actions
    assigned
    dezren39
    on Oct 30, 2026
  5. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    🤖 Agent note · corroboration

    • Agent: new-issue-creator-code-a
    • Found via: this run's filing pass — an independent reproduction of this issue (a duplicate filing, projector(webhook): a delivery whose apply failed is deduped as applied — GitHub redelivery returns 'duplicate' and the event is permanently dropped #2991, was opened in error and is being closed against this issue).
    • Evidence: second laptop probe at ~/git/fleet/probe-2026-10-31-laneA-projredeliver/ (projector from main 689e47c0, real handleRequest + migrate, HMAC-signed fixtures/02-issue-opened.json): transient failure (pmp_items renamed away) → 500 {"error":"apply_failed"} + deliveries row {outcome:"error", detail:"SQLITE_ERROR: no such table: pmp_items"}; redelivery of the same GUID after healing → 200 {"status":"duplicate"}, pmp_items count 0; fresh-GUID control → applied, count 1. Confirms the defect for item events as well as the push events in the original probe.
  6. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    on Nov 1, 2026
  7. 9 remaining items

  8. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · handed off

    • Agent: repo-worker-code
    • Task: Triage queue task 3673 for projector(webhook): a delivery that fails to apply can never be retried — its error row makes every redelivery a 'duplicate', and push events are lost permanently #2456.
    • Finding: Current main (2841b8d) still counts any pmp_deliveries row as applied (store.ts:337-342); server.ts:100-102 short-circuits before parsing; error rows are recorded at :108-109 and :123-124. Independent real-handler probes on 10/29 and 10/31 recorded the failed-then-duplicate behavior.
    • Follow-up: Enqueued small_fix task 5337: projector(webhook): a delivery that fails to apply can never be retried — its error row makes every redelivery a 'duplicate', and push events are lost permanently #2456 — outcome-aware dedupe, retry-safe audit preserving delivery_id PK semantics, and failed-retry/success-duplicate/invalid-JSON regressions. No competing open fix PR found.
    • Next: Implement and test task 5337.
  9. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: repo-worker-code
    • Task: Triage task 3673 completed as triaged.
    • Evidence: Current main 2841b8d retains the failed-delivery duplicate short-circuit; issue projector(webhook): a delivery that fails to apply can never be retried — its error row makes every redelivery a 'duplicate', and push events are lost permanently #2456 remains open. No open competing PR found.
    • Follow-up: Small-fix task 5337 is queued with the regression and audit requirements. Issue labels now reflect the queued small-fix state.
    • Bookkeeping: Sandbox backlog/sweep log deferred to fleet reconciliation.
  10. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    queue/queuedHas a queued queue task
    on Nov 2, 2026
  11. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: repo-worker-code
    • Session / ID: OpenChamber scheduled lane, 2026-11-01 23:00 CDT (ses_e5e655f0900ffe71Ixc9hVKT8B)
    • Found via: repo-health-code-pilot atomic claim, task 5337
    • Task: Implement retry-safe projector webhook delivery handling while preserving original failure audit, with real-handler regression coverage.
    • Current state: Issue projector(webhook): a delivery that fails to apply can never be retried — its error row makes every redelivery a 'duplicate', and push events are lost permanently #2456 is open; no active competing PR found in fresh open-PR search. No hard-stop labels present.
    • Next: Fast-forward laptop primary clone, create/resume task worktree, inspect current code and tests.
  12. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 2, 2026
  13. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · handed off

    • Agent: repo-worker-code
    • Task: Small-fix queue task 5337 for projector(webhook): a delivery that fails to apply can never be retried — its error row makes every redelivery a 'duplicate', and push events are lost permanently #2456.
    • Outcome: Opened PR fix(projector): retry failed webhook deliveries #4186 fix(projector): retry failed webhook deliveries #4186 from queue/5337-2456-projector-webhook-retries.
    • Change: Only applied/ignored deliveries short-circuit; retryable errors can transition to success; first error details remain in pmp_delivery_errors, including legacy-row backfill.
    • Evidence: bun test passed (62 tests, 9 files, 296 assertions); git diff --check passed. PR checks were not yet inspected and are recorded as pending.
    • Next: Review PR checks and merge when green. Queue labels cleared because task 5337 is complete as pr_opened.
  14. dezren39
    added a parent issue on Nov 2, 2026
    • Design: a projection writes only what the event proves — one application contract for the PM projector #4302
  15. dezren39
    added
    source/design-architectFiled by the repo design architect job
    on Nov 2, 2026
  16. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    Design architect, pass 37 (2026-11-02): this issue is adopted as Phase 1 of design #4302 (a projection writes only what the event proves — one application contract for the PM projector), together with #2982, and linked as a sub-issue of #4302. Design doc: files/designs/code-projector-application-contract.md (goal workspace).

    Recorded decision for this phase: dedupe counts success and permanent failure only — deliveryApplied counts a delivery as handled iff its outcome is applied/ignored, or the row is an invalid_json error (that payload can never change, so the behaviour is unchanged there); a transient apply-error row is audit only, redelivery re-applies, and recordDelivery upserts the row retaining the prior error in detail. Triage: record the phase structure — do not re-file, re-scope or split this issue.

  17. dezren39
    closed this as completedin #4186on Nov 2, 2026
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/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect 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.