fix(news): unify digest publication acceptance - #7599
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review SummaryThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6cfa484994
ℹ️ 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".
| // The fetcher publishes attempt + sentinel atomically. Letting the | ||
| // generic wrapper write its own sentinel first would detach identity. | ||
| cacheFailures: false, | ||
| cachePositiveResult: false, |
There was a problem hiding this comment.
Keep digest requests coalesced through publication
When the canonical key is missing, cachePositiveResult: false lets the shared fetch promise resolve and delete its inflight entry before publishAcceptedSnapshot starts. A second request reaching the same isolate while the acceptance EVAL is still running therefore sees another cache miss with no in-flight leader and launches the full RSS digest build again; previously, the positive SET completed inside the shared promise, so this publication interval remained coalesced. Keep the in-flight entry alive until the caller-owned atomic publication finishes.
Useful? React with 👍 / 👎.
6cfa484 to
fb8646d
Compare
fb8646d to
43e4a47
Compare
Keep canonical and durable digest snapshots behind one acceptance gate so a narrower candidate cannot land first.
43e4a47 to
f6a9eba
Compare
Summary
A non-empty but materially narrower digest can no longer replace the canonical cache while the durable fallback keeps the richer snapshot. Canonical and durable publication now use one atomic acceptance decision, so
newsInsightsand other canonical readers retain the last accepted breadth and depth.The gate keeps the current URL-revocation behavior, six-hour durable expiry, and 15-minute canonical expiry. Rejected candidates now have a distinct diagnostic from Redis or source failures.
Validation
node --import tsx --test tests/digest-lastgood-script.test.mjs tests/digest-lastgood.test.mts tests/redis-caching.test.mjs- 159 passed, 0 failed after rebasing onto currentmainnpm run typecheck:api- passed after rebasenpm run lint:boundaries- passed after rebasenpm run test:data- 29,776 passed, 37 skipped, 0 failed before the unrelated one-commit base refresh