{"record":{"id":"6956c50d8bf30ff1","repo":"jackwener/OpenCLI","slug":"twitter-unbookmark-confirmation","errorCode":null,"errorMessage":"twitter unbookmark confirmation","messagePattern":"twitter unbookmark confirmation","errorType":"exception","errorClass":"TimeoutError","httpStatus":null,"severity":"warning","filePath":"clis/twitter/unbookmark.js","lineNumber":67,"sourceCode":"\n            writeStarted = true;\n            removeBtn.click();\n            await new Promise(r => setTimeout(r, 1000));\n\n            // Verify\n            const verifyArticle = findTargetArticle() || targetArticle;\n            const verify = verifyArticle?.querySelector('[data-testid=\"bookmark\"]');\n            if (verify) {\n                return { ok: true, message: 'Tweet successfully removed from bookmarks.' };\n            } else {\n                return { ok: false, unconfirmed: true, message: 'Unbookmark action initiated but UI did not update.' };\n            }\n        } catch (e) {\n            return { ok: false, unconfirmed: writeStarted, message: e.toString() };\n        }\n    })()`);\n        if (result.unconfirmed) {\n            throw new TimeoutError('twitter unbookmark confirmation', 1, `${result.message} Check the tweet before retrying; the removal may already have succeeded.`);\n        }\n        if (!result.ok) {\n            throw new CommandExecutionError(result.message, 'Nothing changed. Open the tweet in the browser and retry.');\n        }\n        await page.wait(2);\n        return [{\n                status: 'success',\n                message: result.message\n            }];\n    }\n});\n","sourceCodeStart":49,"sourceCodeEnd":79,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/twitter/unbookmark.js#L49-L79","documentation":"TimeoutError (code TIMEOUT) labeled 'twitter unbookmark confirmation' with a 1-second confirmation window. The in-page script clicked the bookmark-remove control (writeStarted=true) but success was not confirmed before the script returned, so the library throws with the page error text and warns that the removal may already have succeeded. Users must check the tweet before retrying to avoid double effects.","triggerScenarios":"During `twitter unbookmark`, the evaluate()'d script clicked the bookmark toggle (writeStarted=true) but the confirmation state (bookmark icon/UI update) was not observed, usually because an exception fired after the click or the page was slow to reflect the change.","commonSituations":"Slow X rendering/network after the click; confirmation selector mismatch due to X markup changes; an in-page exception (navigation, detached node) after the click; toast/overlay covering the confirmation element.","solutions":["Open the tweet in the browser and verify whether the bookmark was actually removed before retrying (the hint explicitly warns it may already have succeeded)","Retry once the page has fully loaded on a stable connection","If it consistently times out, suspect an X UI change — update or report the library"],"exampleFix":"// before\nawait cli.run(['twitter', 'unbookmark', tweetUrl]);\n// after\ntry {\n  await cli.run(['twitter', 'unbookmark', tweetUrl]);\n} catch (e) {\n  if (e.code === 'TIMEOUT') console.warn('Unconfirmed — check the tweet manually before retrying');\n}","handlingStrategy":"try-catch","validationCode":"// preflight: ensure the tweet page loads and you are logged in\nawait page.goto(target.url);\nawait page.waitForSelector('[data-testid=\"primaryColumn\"]', { timeout: 10000 });","typeGuard":"function isTimeoutError(e) { return e && e.code === 'TIMEOUT'; }","tryCatchPattern":"try {\n  await cli.run(['twitter', 'unbookmark', tweetUrl]);\n} catch (e) {\n  if (e.code === 'TIMEOUT' && /unbookmark confirmation/.test(e.message)) {\n    // do not auto-retry — check the tweet; removal may have succeeded\n    console.warn('Unconfirmed — check the tweet before retrying');\n  } else throw e;\n}","preventionTips":["Verify bookmark state manually after an unconfirmed timeout before re-running","Run on a stable connection and let the tweet page fully render first","Keep the library current; confirmation selectors break on X UI changes","Avoid concurrent scripts mutating bookmarks on the same session"],"tags":["twitter","timeout","confirmation","browser-write"],"backgroundTag":"write-confirmation-timeout","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}