(
dbManager: DatabaseManager,
sessionId: string,
filePath: string,
options?: ImportOptions & { onProgress?: ImportProgressCallback }
)
| 172 | } |
| 173 | |
| 174 | export async function incrementalImport( |
| 175 | dbManager: DatabaseManager, |
| 176 | sessionId: string, |
| 177 | filePath: string, |
| 178 | options?: ImportOptions & { onProgress?: ImportProgressCallback } |
| 179 | ): Promise<IncrementalImportResult> { |
| 180 | const { onProgress, ...importOpts } = options || {} |
| 181 | let compatibilityError: DataDirCompatibilityError | null = null |
| 182 | const result = await sharedIncrementalImport( |
| 183 | sessionId, |
| 184 | filePath, |
| 185 | buildIncrementalDeps(dbManager, onProgress, (error) => { |
| 186 | compatibilityError = error |
| 187 | }), |
| 188 | importOpts |
| 189 | ) |
| 190 | if (compatibilityError) throw compatibilityError |
| 191 | if (!result.success) return result |
| 192 | |
| 193 | try { |
| 194 | dbManager.raiseCurrentChatDbCompatibilityGate() |
| 195 | } catch (error) { |
| 196 | return { |
| 197 | ...result, |
| 198 | success: false, |
| 199 | newMessageCount: 0, |
| 200 | error: error instanceof Error ? error.message : String(error), |
| 201 | } |
| 202 | } |
| 203 | |
| 204 | return result |
| 205 | } |
| 206 | |
| 207 | export async function analyzeIncrementalImport( |
| 208 | dbManager: DatabaseManager, |
no test coverage detected