WebSockets: a server-side handle to a room, to broadcast to or close its connections from other server code
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 30/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- typescript
- Bereich
- backend, distributed-systems
Rechercherichtung
Start by reading the defineRoom API for *.ws.ts routes and the existing onRequest approach described in the issue; inspect how the generated binding in void.lock.json identifies a room instance. The proposal calls for a supported server-side handle usable from route handlers, auth hooks, queues, and cron jobs. Done means external code can address the same room instance as a client's connect() and use it to broadcast or close selected connections.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Void 1.5.0, Cloudflare target, defineRoom in a *.ws.ts route.
We need to reach a room from server code outside its own hooks. Our case is closing a user's open sockets when their Better Auth session is revoked: databaseHooks.session.delete.after fires on every revoke, sign-out and user deletion, but from there nothing in Void's API reaches the room's Durable Object. The docs only suggest re-checking records in onMessage and closing, which leaves an idle socket of a revoked session open until its next frame, and costs a database read per frame.
The only way we found is undocumented: the binding name Void generates (from void.lock.json), idFromName('<param>=<value>'), and a request handled in onRequest. We do not want to depend on those internals.
Proposal: a server-side handle to a room instance, for example:
import { getRoom } from 'void/ws';
const room = getRoom('/relay/:accountId', { params: { accountId } });
await room.broadcast(event);
await room.close({ code: 4001, reason: 'session revoked', filter: (connection) => connection.state.sessionId === id });
usable from route handlers, auth hooks, queues and cron jobs, and addressing the same instance a client's connect() would.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 627
- Forks
- 66
- Ø Merge
- 14 Std. 38 Min.
- Gemergte PRs (30 T.)
- 179
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus voidzero-dev/void
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
voidzero-dev/void#677 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 52/100
voidzero-dev/void#686 ·
Maintainer antworten meist innerhalb von 1 Tag
-
`VoidActionError.message` ignores the server's message, though the docs show it to usersEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 52/100
voidzero-dev/void#680 ·
Maintainer antworten meist innerhalb von 1 Tag
-
`withValidator({ body })` rejects the multipart bodies that `useForm` and `action()` send for filesOffen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
voidzero-dev/void#679 ·
Maintainer antworten meist innerhalb von 1 Tag
-
`Link`: mark the link to the current page (`aria-current`, `data-active`)Evtl. vergeben @yangshun hat das vor 1 Tag übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
voidzero-dev/void#676 · 2 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in voidzero-dev/void
Ähnliche Issues
-
needs investigation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 60/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
area:visualizer tech-debt
Schwierigkeit 2/5 Unter einer Stunde Anfängerfreundlichkeit 66/100
jmbarzee/temporal-architect#292 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
riverqueue/river#1576 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
colbymchenry/codegraph#3228 ·
Maintainer antworten meist innerhalb von 1 Tag