Skip to content

fix(cache): keep public snapshots fresh while preserving availability - #186

Merged
f0rr0 merged 1 commit into
nextfrom
f0rr0/cache-consistency
Oct 1, 2026
Merged

f0rr0 merged 1 commit into
nextfrom
f0rr0/cache-consistency

Conversation

@f0rr0

@f0rr0 f0rr0 commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Closed Codex history could hide backfills until cache expiry, and late GitHub reads could replace newer cached publications. Refreshing the work timeline also discarded loaded history and expanded rows.

Changes

  • Add transactional Codex revisions covering account changes and usage-day writes, including CLI backfills. Cache closed history for 24 hours with revision checks and read public views from a consistent database snapshot.
  • Key fresh GitHub snapshots by feed and ordering revisions, including ordering-only changes in head responses and ETags.
  • Retain a successful, untagged outage snapshot and bound fresh snapshot attempts to one second. Failed rebuilds do not cache null; cold caches still require the database, and outage snapshots may be older than current data.
  • Preserve the loaded timeline range and expanded rows across publication refreshes, with retries and cancellation of superseded pagination requests.

Validation

  • 289 tests passed, including opt-in tests against disposable PostgreSQL 17 and native Next caches. Covered backfills, rollback, midnight boundaries, concurrent saves, large revision values, stalled history/body reads, and recovery.
  • Lint, unused-code checks, typecheck, and the default Turbopack production build passed.
  • Local production Next fixture reproduced the old in-flight cache race three times and confirmed newer publications survive late completion. A stalled rebuild returned the warm snapshot in approximately one second.
  • Browser checks at 1440px and 390px passed for expansion retention, loaded history, new-day boundaries, ordering-only updates, refresh failure/retry, late pagination responses, duplicate days, overflow, and runtime errors.

Rollout

Apply migration 0029_codex_public_revisions.sql before serving the updated application. No production database changes or deployment have been performed. Production egress savings remain unmeasured.

@vercel

vercel Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
f0rr0-github-io Ready Ready Preview Oct 1, 2026 1:59am UTC

@f0rr0
f0rr0 merged commit 992267f into next Oct 1, 2026
3 of 4 checks passed
@f0rr0
f0rr0 deleted the f0rr0/cache-consistency branch October 1, 2026 02:04

This branch was successfully deployed

1 active deployment
Preview — ee600141 Deployed Oct 1, 2026 by vercel[bot]
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.

1 participant