Skip to content

fix: preserve replica continuity across auth refresh - #252

Merged
patrickleet merged 1 commit into
v5from
fix/auth-refresh-continuity-20260912
Sep 12, 2026
Merged

patrickleet merged 1 commit into
v5from
fix/auth-refresh-continuity-20260912

Conversation

@patrickleet

Copy link
Copy Markdown
Collaborator

Summary

Authorized session refreshes could briefly replace the live page-data source with a seedless SvelteKit update before the authorization fence captured the refresh transfer. The fence then treated the credential transition as unproven, purged the replica, and caused visible rows to disappear while the query revalidated.

This PR captures the auth credential and its independent hydration authority synchronously when a session source notification arrives, before queued transitions can observe a later page-data update. It also adds a regression test for a trusted refresh immediately followed by a seedless update, while preserving the existing purge behavior for an actually unproven credential change.

The gateway workflow now runs when SvelteKit adapter sources or tests change, ensuring this path cannot bypass the application continuity check.

Validation

  • npm test in js — 395/395 tests pass
  • npm run check in js — TypeScript and generated type checks pass
  • Focused regression covers a live WebSocket, trusted authority rotation, seedless invalidation, and later unproven rotation
  • Existing tests/e2e-ui/gateway/refresh.mjs remains unchanged and continues to enforce no visible row loss

Why this targets v5

This is a framework correctness fix and is intentionally separate from the stacked application-contract PRs #248 and #249. Once merged, those PRs can be rebased or rerun against the corrected v5 baseline.

Implements [[tasks/auth-refresh-continuity]].
@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: a4673cf6-7d17-419e-a6ec-b0987431f5a2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@patrickleet
patrickleet merged commit df65edd into v5 Sep 12, 2026
44 of 46 checks passed
@patrickleet
patrickleet deleted the fix/auth-refresh-continuity-20260912 branch September 12, 2026 20:52
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