{"record":{"id":"312736ece3f99944","repo":"toeverything/AFFiNE","slug":"aborterror","errorCode":"AbortError","errorMessage":"Import cancelled","messagePattern":"Import cancelled","errorType":"exception","errorClass":"DOMException","httpStatus":null,"severity":"error","filePath":"packages/frontend/core/src/desktop/dialogs/import/native-backend.ts","lineNumber":33,"sourceCode":"\nconst NATIVE_IMPORT_BATCH_LIMITS = {\n  maxDocs: 20,\n  maxBlobs: 20,\n  maxBlobBytes: 10 * 1024 * 1024,\n};\n\nexport async function commitNativeImport(\n  format: NativeImportFormat,\n  source: File | File[],\n  commitService: ImportCommitService,\n  options: {\n    signal?: AbortSignal;\n    onProgress?: (progress: { completed: number; total: number }) => void;\n  } = {}\n): Promise<ImportCommitResult> {\n  const native = await getNativeImporter();\n  if (options.signal?.aborted) {\n    throw new DOMException('Import cancelled', 'AbortError');\n  }\n  const sessionId = await native.createImportSession({\n    format,\n    source: getNativeImportSource(source),\n    batchLimits: NATIVE_IMPORT_BATCH_LIMITS,\n  });\n\n  const docIds: string[] = [];\n  const warnings: ImportCommitResult['warnings'] = [];\n  let entryId: string | undefined;\n  let isWorkspaceFile = false;\n  let rootFolderId: string | undefined;\n  let cancelled = false;\n\n  try {\n    for (;;) {\n      if (options.signal?.aborted) {\n        cancelled = true;","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/frontend/core/src/desktop/dialogs/import/native-backend.ts#L15-L51","documentation":"commitNativeImport checks the caller-supplied AbortSignal before starting; if the signal is already aborted the import is cancelled upfront by throwing a DOMException('Import cancelled', 'AbortError') instead of creating a session.","triggerScenarios":"Thrown as an AbortError DOMException in commitNativeImport when the provided AbortSignal is aborted, either before starting or between import batches.","commonSituations":"Expected when the user cancels an in-progress desktop import or the dialog closes. It is a normal cancellation path, not a failure.","solutions":["No action needed; the user cancelled the import dialog.","Re-open the import dialog to start a new import."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b4c8548c09da21b2898443559a5b846f0ccf5dd8","analyzedAt":"2026-08-18T21:16:52.546Z","contentChangedAt":"2026-08-18T21:16:52.546Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}