Private-only doorbell: drop the public fallback, surface failures → 0.2.0-next.26 - #24
Merged
Merged
Conversation
Nothing real depends on the pre-private doorbell, so the compat path is deleted
rather than carried. It cost a second realtime.messages insert on every row
change in perpetuity, left an anon-joinable topic protected only by the
obscurity of a schema name that ships in every bundle, and had no retirement
mechanism — a permanent tax and a permanent leak surface to serve users who
don't exist.
With no degraded path available, failure has to be honest: the doorbell retries
with capped backoff (1s/5s/15s/60s, reset by a successful join) and reports
connecting | live | unauthorized | unavailable through status()/onStatus. HTTP
reads keep working, so the app still functions — it just isn't live, and says so
instead of silently limping.
mint() returns a discriminated MintResult so a 403 ("you may not watch this
app") is distinguishable from a network failure or a 404/503. That distinction
matters most for public apps, where every visitor is normally admitted and must
never be told they're unauthorized because a request dropped.
Also removes the id-stripping workaround from next.25 — Realtime's injected
message uuid was only ever observable on the public channel, which no longer
exists.
Verified on dev: anonymous visitor of a public no-auth app mints, joins the app
room, and receives full rows; an anon-key eavesdropper on the old public topic
hears nothing.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Supersedes the compat approach in #21. Nothing real depends on the pre-private doorbell, so the fallback is deleted rather than carried.
Why
The public compat channel cost a second
realtime.messagesinsert on every row change, forever, left an anon-joinable topic protected only by the obscurity of a schema name that ships in every bundle, and had no retirement mechanism. A permanent tax and a permanent leak surface, to serve users who don't exist.What changes
id-stripping workaround from next.25 is gone with the channel that needed it (Realtime's injected message-uuid was only ever observable there).doorbell.status()/onStatusreportingconnecting | live | unauthorized | unavailable. HTTP reads keep working, so an app is never broken — just not live, visibly.mint()returns a discriminatedMintResultso a 403 ("you may not watch this app") is distinguishable from a network failure or 404/503. This matters most for public apps, where every visitor is normally admitted and must never be told they're unauthorized because a request dropped.Public no-auth apps — the primary path
Verified on dev against the real gateway route:
"Private" means wristband-gated, not login-gated — for a public app the gateway hands one to every visitor.
154 pass, typecheck clean. Pairs with codehs/bool#570.