GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(projector): item deletion marker absorbs stale replays (#6782) by dezren39 · Pull Request #6792 · developing-today/code Conversation
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 15 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: 8d5aaa476f
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if (!issue) return; | ||
| await store.upsertItem(fromIssueOrPr(repo, issue, issueIsPr(issue) ? "pr" : "issue")); | ||
| const itemRow = fromIssueOrPr(repo, issue, issueIsPr(issue) ? "pr" : "issue"); | ||
| if (await deletionBlocks(itemRow.ref, itemRow.source_updated_at)) return; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Preserve comment tombstones when the parent deletion blocks writes
If a delayed issue_comment deletion arrives after its parent item was deleted, this early return skips markCommentDeleted, losing the permanent comment tombstone. An in-flight issue_comments reconcile response can subsequently recreate that deleted comment through reconcile.ts's direct upsertComment call, which does not consult item deletion markers, and /comments?refs=... exposes it even though the parent remains absent. Previously, processing the comment deletion persisted a tombstone that blocked that replay. Continue recording comment-deletion tombstones while suppressing parent-item and live-comment writes; the review-comment deletion branch has the same issue.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…writes (#6782) Codex P2 on PR #6792: the deletionBlocks early return in applyComment (and the same shape in the pull_request_review_comment branch) skipped markCommentDeleted for delayed comment deletions, losing the permanent comment tombstone. Reconcile writes comments through a direct upsertComment that consults comment tombstones, not item markers, so the deleted comment could be resurrected while its parent stayed absent. Both branches now still record the tombstone while suppressing the parent-item and live-comment writes. Two projector tests cover the issue_comment and review_comment deletion paths. Suite: 106 pass / 0 fail.
|
Codex finding disposition (lane code-w, shepherding #6782) — replying here because GitHub rejected both API reply forms on the bot's review thread (422 abuse validation on The P2 finding ("Preserve comment tombstones when the parent deletion blocks writes",
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: a7ee1b99f8
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| describe("store: item deletion marker (#6782)", () => { | ||
| const T0 = "2026-10-25T00:00:00Z"; | ||
| const T1 = "2026-10-25T01:00:00Z"; | ||
| const T2 = "2026-10-25T02:00:00Z"; | ||
| const T3 = "2026-10-25T03:00:00Z"; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Add generated coverage for deletion-marker transitions
The new deletion-marker state machine is covered only by fixed example sequences using four timestamps; neither this suite nor the projector cases generate operation sequences to check stale absorption, marker monotonicity, and newer-event recovery across replay orderings. Add property-based or model-generated coverage for these invariants. The root AGENTS.md explicitly requires property tests for meaningful state-machine invariants, so example-only coverage does not satisfy the repository's testing doctrine.
AGENTS.md reference: AGENTS.md:L41-L41
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| const marker = await getItemDeletion(db, i.ref); | ||
| if (marker) { | ||
| if (marker.source_updated_at >= i.source_updated_at) return; | ||
| await db.execute({ sql: `DELETE FROM pmp_item_deletions WHERE ref = ?`, args: [i.ref] }); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Make the marker check and item write atomic
When reconciliation and a deletion webhook overlap, an upsert at source time T2 can read an existing marker T1, then deleteItem can refresh it to T3 before this unconditional DELETE executes. The upsert then removes the newer T3 marker and recreates the stale item, permanently losing its deletion protection. The production handlers in server.ts allow reconciliation and webhook processing concurrently without serialization. Make the marker comparison/removal and item writes atomic relative to deleteItem, rather than removing whichever marker exists based on an earlier read.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…odel coverage (#6782) Codex round 2 on PR #6792. P2 (store.ts): upsertItem read the marker, then unconditionally deleted it - a deleteItem landing in between could refresh the marker, and the upsert removed the newer marker and recreated the stale item. upsertItem and deleteItem now each run as one write batch (single transaction): the marker clear only removes markers strictly older than the incoming event, and both item writes are guarded by NOT EXISTS over whatever marker survives the clear, so a mid-flight refresh blocks the writes instead of being discarded. P1 (testing doctrine): the marker state machine is now also covered by a model-based generated test - a fixed-seed PRNG drives 40 interleaved upsert/delete sequences across three refs and four timestamps, checking the real store against a two-field contract model (monotonic marker; newest landed upsert) after every operation. Suite: 107 pass / 0 fail, 2727 expect() calls.
|
Codex round-2 disposition (lane code-w, shepherding #6782) — posted via the developing.today App because the user token is secondary-rate-limited tonight; thread replies to bot comments were also rejected by GitHub (422), so dispositions live here, per finding:
Full projector suite after both fixes: 107 pass / 0 fail, 2727 expect() calls ( |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
projector(items): persist an item deletion marker so stale replays cannot resurrect a deleted issue (follow-up of #4210)
There was an error while loading. Please reload this page.