MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / incrementalImportFile

Method incrementalImportFile

apps/desktop/main/api/adapters.ts:127–140  ·  view source on GitHub ↗
(sessionId: string, tempFile: string)

Source from the content-addressed store, hash-verified

125 }
126
127 private async incrementalImportFile(sessionId: string, tempFile: string): Promise<ImportResult> {
128 this.logger.info(`[Pull] Incremental import to session ${sessionId}`)
129 const result = await worker.incrementalImport(sessionId, tempFile)
130 if (result.success) {
131 this.logger.info(`[Pull] Incremental OK: +${result.newMessageCount} messages`)
132 return { success: true, newMessageCount: result.newMessageCount, sessionId }
133 }
134 if (result.error === 'error.session_not_found' || result.error?.includes('no such table')) {
135 this.logger.warn(`[Pull] Session ${sessionId} not found or schema invalid, need full resync`)
136 return { success: false, newMessageCount: 0, sessionId, needFullResync: true }
137 }
138 this.logger.error(`[Pull] Incremental import failed: ${result.error}`)
139 return { success: false, newMessageCount: 0, sessionId, error: result.error }
140 }
141
142 private async fullImportFile(tempFile: string, externalId: string): Promise<ImportResult> {
143 this.logger.info(`[Pull] First import via streamImport (externalId=${externalId})`)

Callers 1

importFileMethod · 0.95

Calls 4

infoMethod · 0.65
incrementalImportMethod · 0.65
warnMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected