{"record":{"id":"8403d77f58d31700","repo":"jackwener/OpenCLI","slug":"xiaohongshu-delete-note-note-noteid-still-visi","errorCode":null,"errorMessage":"xiaohongshu/delete-note: note ${noteId} still visible after confirm click; deletion may not have committed.","messagePattern":"xiaohongshu/delete-note: note (.+?) still visible after confirm click; deletion may not have committed\\.","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/xiaohongshu/delete-note.js","lineNumber":240,"sourceCode":"            if (!confirmResult?.ok) {\n                throw new CommandExecutionError(`xiaohongshu/delete-note: confirmation modal step failed (${confirmResult?.kind ?? 'unknown'})`);\n            }\n            // Step 4: poll for row removal (proves the delete actually committed,\n            // not just the modal was clicked). Iteration-bounded rather than\n            // wall-clock so tests with a mocked `page.wait` exhaust the loop\n            // quickly instead of stalling on real time.\n            const VERIFY_ITERATIONS = Math.ceil(VERIFY_TIMEOUT_MS / VERIFY_POLL_MS);\n            let stillPresent = true;\n            for (let i = 0; i < VERIFY_ITERATIONS; i++) {\n                await page.wait({ time: VERIFY_POLL_MS / 1000 });\n                const probe = requireEvaluateBoolean(unwrapEvaluateResult(await page.evaluate(buildVerifyGoneScript(noteId))), 'verify-gone');\n                if (probe === false) {\n                    stillPresent = false;\n                    break;\n                }\n            }\n            if (stillPresent) {\n                throw new CommandExecutionError(`xiaohongshu/delete-note: note ${noteId} still visible after confirm click; deletion may not have committed.`);\n            }\n            return [{ status: 'deleted', note_id: noteId, message: 'Delete confirmed and note row disappeared.' }];\n        }\n        catch (err) {\n            if (err instanceof CliError)\n                throw err;\n            throw new CommandExecutionError(`xiaohongshu/delete-note failed: ${err?.message ?? String(err)}`);\n        }\n    },\n});\nexport const __test__ = {\n    normalizeNoteId,\n    buildLocateAndMaybeDeleteScript,\n    buildVerifyGoneScript,\n};\n","sourceCodeStart":222,"sourceCodeEnd":256,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/xiaohongshu/delete-note.js#L222-L256","documentation":"After clicking 确定, the CLI polls (1s interval, up to 10s) for the note row to disappear from the Published list; the row's disappearance is the proof the delete actually committed server-side. If the row is still present when polling exhausts, the CLI throws this CommandExecutionError warning that the deletion may not have committed — the confirm click happened but the state never changed.","triggerScenarios":"The confirm click didn't actually submit the delete (silent frontend error or failed API call); server-side deletion is slower than the 10s verify window; the row remains in the DOM because the list re-fetch lagged; an API error toast appeared but the script only polls the row list; rate limiting or moderation state blocking deletion.","commonSituations":"XHS backend latency over 10 seconds during peak times; the modal confirm triggering a failed request (network hiccup, auth token expired mid-flow); the row cached in the list UI; the account hitting delete rate limits.","solutions":["Check creator.xiaohongshu.com in the browser: if the note is actually gone, the deletion succeeded and only the verification poll was too short (increase VERIFY_TIMEOUT_MS)","If the note still exists, re-run the delete-note command from the start","Retry after a short delay if XHS was slow; check for rate limiting or error toasts during the flow","Re-login to creator.xiaohongshu.com if the session token expired mid-flow, then retry"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await cli('xiaohongshu', 'delete-note', { note: noteId });\n} catch (err) {\n  if (err instanceof CommandExecutionError && err.message.includes('still visible after confirm click')) {\n    // Confirm was clicked — verify actual state before retrying to avoid double-delete\n    const stillThere = await noteStillListed(noteId);\n    if (stillThere) console.error('Deletion did not commit; safe to re-run the command.');\n    return;\n  }\n  throw err;\n}","preventionTips":["Verify the note's actual state in the browser before re-running — the confirm click already happened and deletion may have committed slowly","Avoid tight retry loops; XHS backend deletes can lag beyond the 10s verify window","Watch for rate limiting; space out bulk deletions","Ensure the session is healthy (re-login if auth tokens expired mid-flow) so the confirm request isn't silently rejected"],"tags":["verification","browser-automation","timeout"],"backgroundTag":"delete-verification-timeout","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}