(
baseUrl: string,
sess: ImportSession,
tempFile: string
)
| 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) |
no test coverage detected