Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

refactor(server): drop the state helpers the injected stores replaced

Maurice2b218a552892
diff --git a/server/src/nest/permissions/permissions-cache.ts b/server/src/nest/permissions/permissions-cache.ts
index cc90638ea..dcc42aa9a 100644
--- a/server/src/nest/permissions/permissions-cache.ts
+++ b/server/src/nest/permissions/permissions-cache.ts
@@ -59,11 +59,6 @@ export function getPermissionsCache(): Promise<Map<string, PermissionLevel> | nu
return permissionsCacheSlot.get().get();
}
-/** Install a fresh cache map and return it (the loader fills it in place). */
-export function setPermissionsCache(next: Map<string, PermissionLevel>): Promise<Map<string, PermissionLevel>> {
- return permissionsCacheSlot.get().set(next);
-}
-
export function invalidatePermissionsCache(): Promise<void> {
return permissionsCacheSlot.get().invalidate();
}
diff --git a/server/src/nest/realtime/ws-state.ts b/server/src/nest/realtime/ws-state.ts
index 375987b29..7cff7a551 100644
--- a/server/src/nest/realtime/ws-state.ts
+++ b/server/src/nest/realtime/ws-state.ts
@@ -174,14 +174,6 @@ export function joinRoom(ws: TrekWebSocket, tripId: number): void {
roomsSlot.get().join(ws, tripId);
}
-export function leaveRoom(ws: TrekWebSocket, tripId: number): void {
- roomsSlot.get().leave(ws, tripId);
-}
-
-export function leaveAllRooms(ws: TrekWebSocket): void {
- roomsSlot.get().leaveAll(ws);
-}
-
// ── Studio books ──────────────────────────────────────────────────────────
export interface BookPeer {
@@ -199,11 +191,6 @@ export function leaveBook(ws: TrekWebSocket, journeyId: number): void {
roomsSlot.get().leaveBook(ws, journeyId);
}
-/** Every book this socket had open — called when the connection goes. */
-export function leaveAllBooks(ws: TrekWebSocket): number[] {
- return roomsSlot.get().leaveAllBooks(ws);
-}
-
/**
* Who is in a book, by socket rather than by user.
*