MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / importTempFile

Method importTempFile

packages/sync/src/pull-engine.ts:194–216  ·  view source on GitHub ↗
(
    baseUrl: string,
    sess: ImportSession,
    tempFile: string
  )

Source from the content-addressed store, hash-verified

192 }
193
194 private async importTempFile(
195 baseUrl: string,
196 sess: ImportSession,
197 tempFile: string
198 ): Promise<{
199 success: boolean
200 newMessageCount: number
201 sessionId?: string
202 error?: string
203 needFullResync?: boolean
204 }> {
205 let targetId = sess.targetSessionId
206 if (!targetId) {
207 const derived = deriveLocalSessionId(baseUrl, sess.remoteSessionId)
208 if (this.importer.sessionExists(derived)) {
209 targetId = derived
210 this.logger.info(`[Pull] Reusing existing local session ${derived} for "${sess.name}"`)
211 }
212 }
213
214 const externalId = deriveLocalSessionId(baseUrl, sess.remoteSessionId)
215 return this.importer.importFile(tempFile, targetId || undefined, externalId)
216 }
217
218 async executePullSession(sourceId: string, ds: DataSource, sess: ImportSession): Promise<PullSessionResult> {
219 const currentDs = this.dsManager.get(sourceId)

Callers 1

executePullSessionMethod · 0.95

Calls 4

deriveLocalSessionIdFunction · 0.85
sessionExistsMethod · 0.65
infoMethod · 0.65
importFileMethod · 0.65

Tested by

no test coverage detected