MCPcopy Create free account
hub / github.com/tiann/hapi / insertLegacy

Function insertLegacy

hub/src/sync/syncEngineAutoMigrate.test.ts:198–213  ·  view source on GitHub ↗
(sessionId: string)

Source from the content-addressed store, hash-verified

196 // Insert a real cursor legacy session into the store so the helper's
197 // metadata writes have something to update.
198 function insertLegacy(sessionId: string): Session {
199 const cache = (engine as unknown as { sessionCache: import('./sessionCache').SessionCache }).sessionCache
200 const persisted = cache.getOrCreateSession(
201 sessionId,
202 {
203 path: '/tmp/proj',
204 host: 'localhost',
205 flavor: 'cursor',
206 cursorSessionId: 'cursor-uuid-real',
207 cursorSessionProtocol: 'stream-json'
208 },
209 null,
210 'default'
211 )
212 return persisted
213 }
214 function getStoredMetadata(sessionId: string): Record<string, unknown> | undefined {
215 const store = (engine as unknown as { store: Store }).store
216 const row = store.sessions.getSession(sessionId)

Callers 1

Calls 1

getOrCreateSessionMethod · 0.45

Tested by

no test coverage detected