Skip to content

[D] Invalidate recon ETags on webhook projection - #22

Merged
FlyOverCoderKY merged 3 commits into
mainfrom
grok/github-release-webhook-phase-d-etag
Jul 29, 2026
Merged

FlyOverCoderKY merged 3 commits into
mainfrom
grok/github-release-webhook-phase-d-etag

Conversation

@FlyOverCoderKY

Copy link
Copy Markdown
Contributor

Summary

Follow-up to Phase D: webhook projection that upserts/deletes a repository now clears that repository's reconciliation ETag.

Why

Sequence that left wrong local state:

  1. Recon caches ETag for stable release A
  2. Webhook projects newer B (ETag for A still stored)
  3. Delete of B is missed
  4. GitHub is A again with the same ETag → recon 304s and only refreshes observedAt on B

Fix

markReleaseWebhookSuccess(store, at, repositoryId) drops the per-repo ETag when projection kind is upsert/delete.

Tests

npm run test:node — 108 pass including explicit 304-mask regression.

Prevents a cached GitHub ETag for an older stable release from 304-masking recon after a missed delete of a later release that a webhook had projected.
Copilot AI review requested due to automatic review settings July 29, 2026 02:43
@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@FlyOverCoderKY

Copy link
Copy Markdown
Contributor Author

@codex review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a reconciliation correctness edge case in the Worker’s GitHub Releases pipeline by invalidating per-repository reconciliation ETags after a webhook projection mutates local state, preventing a later 304 response from masking a missed delete/unpublish.

Changes:

  • Extend markReleaseWebhookSuccess to optionally clear a specific repository’s cached reconciliation ETag.
  • Pass the repository ID from the GitHub release webhook handler only when the projection kind is upsert or delete.
  • Add targeted regression tests covering the “304-mask after missed delete” scenario and the ETag clearing behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
worker/src/release-reconciliation.test.ts Adds an end-to-end regression test ensuring reconciliation does not send If-None-Match after a webhook upsert/delete invalidates the repo ETag.
worker/src/release-ops-state.ts Updates webhook success marker to optionally delete a repo’s cached reconciliation ETag while recording webhook success time.
worker/src/release-ops-state.test.ts Adds a unit test asserting a repository ETag is removed on webhook projection success.
worker/src/github-release-webhook.ts Wires repository-scoped ETag invalidation into webhook processing for upsert/delete projections only.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 095baa779c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread worker/src/github-release-webhook.ts Resolved
Comment thread worker/src/release-ops-state.ts Resolved
Invalidate repository ETags on the webhook critical path before markProcessed, and merge recon ETag updates into the live map so concurrent invalidations are not restored.
@FlyOverCoderKY

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b7badbfaa3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread worker/src/release-reconciliation.ts Resolved
@FlyOverCoderKY

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 2e50ea98a4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@FlyOverCoderKY
FlyOverCoderKY merged commit 1b13ca2 into main Jul 29, 2026
1 check passed
@FlyOverCoderKY
FlyOverCoderKY deleted the grok/github-release-webhook-phase-d-etag branch July 29, 2026 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants