{"record":{"id":"27444fbb0928577c","repo":"jackwener/OpenCLI","slug":"quark-save-task-timed-out","errorCode":null,"errorMessage":"quark: Save task timed out","messagePattern":"quark: Save task timed out","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/quark/save.js","lineNumber":74,"sourceCode":"            fidList = [...new Set(fids.split(',').map(id => id.trim()).filter(Boolean))];\n        }\n        const targetFid = toFid || await findFolder(page, to);\n        const taskId = await saveShare(page, pwdId, stoken, fidList, targetFid, saveAll);\n        const result = {\n            success: false,\n            task_id: taskId,\n            saved_to: to || toFid,\n            target_fid: targetFid,\n            ...(saveAll ? {} : { fids: fidList }),\n        };\n        if (taskId) {\n            const completed = await pollTask(page, taskId, (task) => {\n                result.save_count = task.save_as?.save_as_sum_num;\n            });\n            result.completed = completed;\n            result.success = completed;\n            if (!completed)\n                throw new CommandExecutionError('quark: Save task timed out');\n        }\n        else {\n            result.success = true;\n        }\n        return result;\n    },\n});\n","sourceCodeStart":56,"sourceCodeEnd":82,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/quark/save.js#L56-L82","documentation":"Thrown by clis/quark/save.js when the share-save task created by saveShare never completes during pollTask retries. While polling, the command also captures task.save_as.save_as_sum_num as save_count, but if the task never signals completion, result.success stays false and a CommandExecutionError is raised.","triggerScenarios":"Saving large shares where the server-side save_as task takes longer than the polling budget; share link expired or restricted mid-task; Quark backend queue congestion; task permanently failed (e.g. target quota exceeded) so completion never arrives.","commonSituations":"Bulk-saving big shared folders at peak times; destination drive near storage quota; share link requiring passcode/stoken that became invalid during the operation.","solutions":["Re-run the save command; check whether files actually appeared in the target folder first to avoid duplicates.","Reduce batch size (save specific fids with --fids + --stoken) so the task completes faster.","Verify destination account storage quota is sufficient for the share contents.","Confirm the share link is still valid and the stoken hasn't expired; then retry.","Retry later if Quark's service is degraded."],"exampleFix":"// before\nif (!completed)\n  throw new CommandExecutionError('quark: Save task timed out');\n// after\nif (!completed) {\n  await new Promise(r => setTimeout(r, 5000));\n  result.completed = await pollTask(page, taskId, (task) => {\n    result.save_count = task.save_as?.save_as_sum_num;\n  });\n  if (!result.completed)\n    throw new CommandExecutionError('quark: Save task timed out');\n}","handlingStrategy":"retry","validationCode":"// pre-checks before saving\nconst targetFree = await getQuota(page);\nconst shareSize = await estimateShareSize(page);\nif (targetFree < shareSize) throw new Error('insufficient quota for save');","typeGuard":null,"tryCatchPattern":"try {\n  const res = await save(page, args);\n} catch (e) {\n  if (e.message.includes('Save task timed out')) {\n    // check for partial completion, then retry remaining fids\n    const existing = await files(page, { fid: targetFid });\n    const remaining = diffFids(requestedFids, existing);\n    if (remaining.length) await save(page, { ...args, fids: remaining.join(',') });\n  } else throw e;\n}","preventionTips":["Ensure sufficient storage quota in the destination account.","Save in smaller batches with --fids + --stoken.","Verify share links are still valid before bulk saves.","Retry with backoff; check target folder for partial saves before re-running."],"tags":["timeout","async-task","polling","quark"],"backgroundTag":"async-task-poll-timeout","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}