decentralised sync engine
0
fork

Configure Feed

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

refactor: move sessions to persisted state

serenity 7c34ea9f 6e9b7950

+6 -6
+1 -6
src/lib/setup.ts
··· 1 + import { channelSessions } from "@/lib/state"; 1 2 import type { AtUri, Did } from "@/lib/types/atproto"; 2 - import type { SessionInfo } from "@/lib/types/handshake"; 3 3 import { systemsGmstnDevelopmentChannelRecordSchema } from "@/lib/types/lexicon/systems.gmstn.development.channel"; 4 4 import { 5 5 atUriToString, ··· 81 81 } 82 82 }); 83 83 84 - // TODO: move this to a persisted state 85 - const channelSessions = new Map<AtUri, SessionInfo>(); 86 - 87 84 const channelsByShardEntries = channelsByShard.entries(); 88 85 89 86 for (const entry of channelsByShardEntries) { ··· 113 110 if (!handshakeResult.ok) continue; 114 111 const sessionInfo = handshakeResult.data; 115 112 console.log("Handshake to", shardAtUri.rKey, "complete!"); 116 - console.log("Session info:", sessionInfo); 117 113 channelSessions.set(shardAtUri, sessionInfo); 118 114 } 119 - console.log(channelSessions); 120 115 };
+5
src/lib/state.ts
··· 1 + import type { AtUri } from "@/lib/types/atproto"; 2 + import type { SessionInfo } from "@/lib/types/handshake"; 3 + 1 4 export const registrationState = { 2 5 registered: false, 3 6 }; ··· 10 13 export const getRegistrationState = () => { 11 14 return registrationState; 12 15 }; 16 + 17 + export const channelSessions = new Map<AtUri, SessionInfo>();