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

Method fullImportFile

apps/cli/src/sync/adapters.ts:131–146  ·  view source on GitHub ↗
(tempFile: string, externalId: string)

Source from the content-addressed store, hash-verified

129 }
130
131 private async fullImportFile(tempFile: string, externalId: string): Promise<ImportResult> {
132 try {
133 const result = await streamImport(this.dbManager, tempFile, { sessionId: externalId })
134
135 if (result.success) {
136 const newMessageCount = result.diagnostics?.messagesWritten ?? 0
137 this.logger.info(`[DirectImporter] Full import OK: +${newMessageCount} messages`)
138 return { success: true, newMessageCount, sessionId: result.sessionId ?? externalId }
139 }
140
141 return { success: false, newMessageCount: 0, error: result.error }
142 } catch (err: any) {
143 this.logger.error(`[DirectImporter] Full import failed`, err)
144 return { success: false, newMessageCount: 0, error: err.message }
145 }
146 }
147}
148
149// ==================== NoopNotifier ====================

Callers 1

importFileMethod · 0.95

Calls 3

streamImportFunction · 0.90
infoMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected