Skip to content

Commit e1f770a

Browse files
committed
fix(realtime): revert kebab-case party conversion — dispatcher routes by JWT script_name, not URL party name
1 parent 9260662 commit e1f770a

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

src/modules/realtime.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ function socketKey(handlerName: string, instanceId: string) {
77
return `${handlerName}:${instanceId}`;
88
}
99

10-
// partyserver maps binding names via camelCaseToKebabCase before routing
11-
function toKebab(str: string): string {
12-
return str.replace(/[A-Z]/g, (l) => `-${l.toLowerCase()}`).replace(/^-/, "");
13-
}
14-
1510
export function createRealtimeModule(config: {
1611
appId: string;
1712
getToken(handlerName: string, instanceId: string): Promise<string>;
@@ -26,10 +21,9 @@ export function createRealtimeModule(config: {
2621
activeSockets.get(key)?.close();
2722

2823
// query as async fn: called on every (re)connect, fetches a fresh token each time
29-
// party must be kebab-case: partyserver maps binding names via camelCaseToKebabCase
3024
const ws = new PartySocket({
3125
host: config.dispatcherWsUrl,
32-
party: toKebab(handlerName),
26+
party: handlerName,
3327
room: instanceId,
3428
query: () => config.getToken(handlerName, instanceId).then((token) => ({ token })),
3529
});

0 commit comments

Comments
 (0)