- make addTreeNode receivers idempotent (invalidateOnCreatePage guard + buildTree dedup) so the author's self-echo no longer duplicates the node - broadcast realtime tree updates for bulk copy/duplicate and import via a root refetch: PAGE_CREATED now carries spaceId and the WS listener falls back to refetchRootTreeNodeEvent when no per-node snapshot is present - remove the now-dead client-relay inbound path (isTreeEvent/handleTreeEvent) that remained a stale-restriction-cache attack surface - honest string|null cast for a root move's parent id - add tests: buildTree dedup; onPageCreated per-node vs refetch branching Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
11 lines
294 B
TypeScript
11 lines
294 B
TypeScript
export const WS_CACHE_TTL_MS = 30_000;
|
|
export const WS_SPACE_RESTRICTION_CACHE_PREFIX = 'ws:space-restrictions:';
|
|
|
|
export function getSpaceRoomName(spaceId: string): string {
|
|
return `space-${spaceId}`;
|
|
}
|
|
|
|
export function getUserRoomName(userId: string): string {
|
|
return `user-${userId}`;
|
|
}
|