{"record":{"id":"d48a43572339f57b","repo":"jackwener/OpenCLI","slug":"awemeid-d48a43","errorCode":null,"errorMessage":"抖音作品 ${awemeId} 删除后仍在作品列表中，删除未确认","messagePattern":"抖音作品 (.+?) 删除后仍在作品列表中，删除未确认","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/douyin/delete.js","lineNumber":150,"sourceCode":"                throw fallbackError;\n            }\n        }\n\n        const before = await findWorkListItem(page, awemeId);\n        if (!before) {\n            throw new CommandExecutionError(`抖音作品 ${awemeId} 未在作品列表中找到，未执行删除`);\n        }\n        const url = 'https://creator.douyin.com/web/api/media/aweme/delete/?aid=1128';\n        await browserFetch(page, 'POST', url, { body: { aweme_id: awemeId }, timeoutMs: 8000 });\n        const deadline = Date.now() + 10_000;\n        while (Date.now() < deadline) {\n            await sleep(500);\n            const after = await findWorkListItem(page, awemeId);\n            if (!after) {\n                return [{ status: `✅ 已删除 ${awemeId}` }];\n            }\n        }\n        throw new CommandExecutionError(`抖音作品 ${awemeId} 删除后仍在作品列表中，删除未确认`);\n    },\n});\n","sourceCodeStart":132,"sourceCodeEnd":153,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/douyin/delete.js#L132-L153","documentation":"Thrown after POSTing the aweme/delete API: the library polls the work list for up to 10 seconds (500ms intervals) and throws if the aweme_id still appears, meaning the delete was not confirmed. Douyin deletion can be asynchronous; the library refuses to report success without confirmation.","triggerScenarios":"The delete API returned 200 but deletion is pending/asynchronous server-side; the delete actually failed silently (risk-control or permission issue); the work list cache still serves the item; findWorkListItem keeps matching due to stale list data.","commonSituations":"Deleting large videos whose removal takes >10s to propagate; account under risk-control where delete API calls are silently dropped; cookie/session partially valid so the POST is ignored.","solutions":["Increase the polling deadline beyond 10s and retry — propagation can be slow","Re-run the delete; if it persists, delete manually from creator-micro to confirm the work's state","Check the delete API response body for error fields instead of assuming 200 means accepted","Re-login if risk-control or partial session is suspected"],"exampleFix":"// before\nconst deadline = Date.now() + 10_000;\n// after: longer window with exponential backoff\nlet deadline = Date.now() + 60_000;\nwhile (Date.now() < deadline) { await sleep(2000); if (!await findWorkListItem(page, awemeId)) return ok; }\nthrow new CommandExecutionError(`delete unconfirmed for ${awemeId}`);","handlingStrategy":"retry","validationCode":"// confirm the delete POST itself reported success before relying on polling\nconst delRes = await browserFetch(page, 'POST', deleteUrl, { body: { aweme_id: id } });\nif (delRes?.error) throw new Error('delete API rejected: ' + JSON.stringify(delRes));","typeGuard":"function isGoneFromList(list, awemeId) {\n  return Array.isArray(list) && !list.some(e => String(e.aweme_id ?? e.item_id ?? '') === String(awemeId));\n}","tryCatchPattern":"try {\n  await deleteCommand(page, awemeId);\n} catch (e) {\n  if (/删除后仍在作品列表中/.test(e.message)) {\n    await sleep(30000); // allow server-side propagation\n    const still = await findWorkListItem(page, awemeId);\n    if (!still) return 'deleted (confirmed late)';\n  } throw e;\n}","preventionTips":["Allow generous time for Douyin's asynchronous deletion to propagate","Check the delete API response body for silent rejection (risk-control)","Re-login if deletes are consistently unconfirmed — partial sessions get ignored","Verify manually on creator-micro if a specific work never clears from the list"],"tags":["douyin","delete","timeout","async"],"backgroundTag":"delete-not-confirmed","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}