decentralised sync engine
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor: rename persisted state

serenity 7ae7189e 7c34ea9f

+5 -3
+2 -2
src/lib/setup.ts
··· 1 - import { channelSessions } from "@/lib/state"; 1 + import { handshakeTokens, shardSessions } from "@/lib/state"; 2 2 import type { AtUri, Did } from "@/lib/types/atproto"; 3 3 import { systemsGmstnDevelopmentChannelRecordSchema } from "@/lib/types/lexicon/systems.gmstn.development.channel"; 4 4 import { ··· 110 110 if (!handshakeResult.ok) continue; 111 111 const sessionInfo = handshakeResult.data; 112 112 console.log("Handshake to", shardAtUri.rKey, "complete!"); 113 - channelSessions.set(shardAtUri, sessionInfo); 113 + handshakeTokens.set(shardAtUri, sessionInfo); 114 114 } 115 115 };
+3 -1
src/lib/state.ts
··· 1 1 import type { AtUri } from "@/lib/types/atproto"; 2 2 import type { SessionInfo } from "@/lib/types/handshake"; 3 + import type WebSocket from "ws"; 3 4 4 5 export const registrationState = { 5 6 registered: false, ··· 14 15 return registrationState; 15 16 }; 16 17 17 - export const channelSessions = new Map<AtUri, SessionInfo>(); 18 + export const handshakeTokens = new Map<AtUri, SessionInfo>(); 19 + export const shardSessions = new Map<SessionInfo, WebSocket>();