Repository navigation
feat(realtime): resilient replay, route ownership, authenticated ingress and wildcard topics - #426
Open
softnationz wants to merge 1 commit into
Conversation
|
@softnationz Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Realtime subscription intents previously disappeared during socket outages, and the client dispatched unbound payloads without owning route subscription lifetimes. This adds one desired-state registry and reconciliation path for offline changes, authenticated reconnect/resume, wildcard interests, and route owners.
/,/cover,/provideand nested segments. Fetch bounded initial snapshots without blocking rendering, retain shared interests, debounce rapid navigation, release departing interests, and optionally prefetch same-origin link intent with a five-second lifetime. Unmapped routes retain independent hook-owned subscriptions.*, and terminal**patterns. Negotiate server wildcard support or enumerate a configured concrete catalog. Deduplicate wire interests and deliver once per registration.docs/realtime.md.Security / integration contract
Uses issue #270's authenticated-session binding option, not application-layer signatures. TLS authenticates the allowed endpoint; session binding rejects unsigned legacy envelopes, cross-session events, forged bindings, and replay. It cannot independently authenticate events from a compromised trusted backend. No runtime verification bypass exists, including in mock mode.
The original frontend documented an unimplemented backend transport contract. The backend must implement the documented v1 handshake/resume/envelope contract before streaming succeeds; incompatible feeds fail closed and REST remains available. Default fallback enumeration covers the three public flat topics; hierarchical variants require a complete configured catalog or negotiated server wildcard capability.
Validation
npx vitest run --config vitest.config.mts src/lib/realtime/client.test.ts src/lib/realtime/topics.benchmark.test.ts.no-restricted-syntaxselector disabled on the command line; no lint configuration changed.git diff --checkpasses; one commit on current upstream8260266, authored and committed by authenticated accountsoftnationz, with no co-author trailers.Existing upstream verification blockers
Verified against an isolated checkout of upstream main with the same installed dependencies; the full failure listings are identical:
npm cifails because upstreampackage-lock.jsoncontains invalid JSON at line 1459. Local validation usednpm install --package-lock=false --ignore-scripts --legacy-peer-depsbecause upstream also has a Vite/plugin peer conflict; manifests and lockfile are unchanged.npm testloads upstream's emptyvitest.config.ts; the existingvitest.config.mtssupplies the required alias/include configuration.npm run typecheckandnpm run buildfail on existing malformed JSX insrc/app/cover/page.tsx; build also reports the malformed lockfile.npm run lintfails on the existingLiteral[value=1e7]selector in.eslintrc.json.These unrelated files are intentionally excluded from this PR. CI cannot be represented as passing until baseline issues are repaired. Maintainer review and approval remain required.
Closes #271
Closes #268
Closes #270
Closes #269