MCPcopy Create free account
hub / github.com/winfunc/opcode / loadSession

Method loadSession

src/services/sessionPersistence.ts:52–69  ·  view source on GitHub ↗

* Load session data for restoration

(sessionId: string)

Source from the content-addressed store, hash-verified

50 * Load session data for restoration
51 */
52 static loadSession(sessionId: string): SessionRestoreData | null {
53 try {
54 const data = localStorage.getItem(`${STORAGE_KEY_PREFIX}${sessionId}`);
55 if (!data) return null;
56
57 const sessionData = JSON.parse(data) as SessionRestoreData;
58
59 // Validate the data
60 if (!sessionData.sessionId || !sessionData.projectId || !sessionData.projectPath) {
61 return null;
62 }
63
64 return sessionData;
65 } catch (error) {
66 console.error('Failed to load session data:', error);
67 return null;
68 }
69 }
70
71 /**
72 * Remove session data from storage

Callers 3

cleanupOldSessionsMethod · 0.95
isSessionRestorableMethod · 0.95
loadTabsFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected