{"record":{"id":"bab95764f0557879","repo":"jackwener/OpenCLI","slug":"twitter-unblock-confirmation","errorCode":null,"errorMessage":"twitter unblock confirmation","messagePattern":"twitter unblock confirmation","errorType":"exception","errorClass":"TimeoutError","httpStatus":null,"severity":"warning","filePath":"clis/twitter/unblock.js","lineNumber":78,"sourceCode":"                return { ok: false, message: 'Unblock confirmation dialog did not appear.' };\n            }\n            writeStarted = true;\n            confirmBtn.click();\n            await new Promise(r => setTimeout(r, 1000));\n\n            // Verify\n            const verify = getPrimary()?.querySelector('[data-testid$=\"-follow\"]');\n            if (verify) {\n                return { ok: true, message: 'Successfully unblocked @${username}.' };\n            } else {\n                return { ok: false, unconfirmed: true, message: 'Unblock 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 unblock confirmation', 1, `${result.message} Check the profile before retrying; the unblock may already have succeeded.`);\n        }\n        if (!result.ok) {\n            throw new CommandExecutionError(result.message, 'Nothing changed. Open the profile 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":60,"sourceCodeEnd":90,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/twitter/unblock.js#L60-L90","documentation":"TimeoutError (code TIMEOUT) with label 'twitter unblock confirmation' and a 1-second window. The in-page write script sets writeStarted when it clicks the unblock control, but the confirmation state was not observed before the script finished, so the library cannot confirm success and throws with a hint to verify the profile manually. The message surfaces the underlying page error (`result.message`) plus a warning that the unblock may already have succeeded.","triggerScenarios":"During `twitter unblock`, the evaluate()'d script clicked the unblock button (writeStarted=true) but the post-click confirmation (button state change / UI reflecting 'unblocked') was not detected within the 1s confirmation window, typically because an in-page exception fired after the click.","commonSituations":"Slow X page rendering or laggy network right after the click; an overlay/toast intercepting the confirmation selector; X markup change for the confirmation state; page threw mid-script (e.g. navigation or detached node) after the click landed.","solutions":["Open the profile at https://x.com/<username> and visually check whether the unblock already took effect before retrying (the hint says retrying blindly may double-fire)","Retry the command on a faster/stabler connection once the page loads fully before invoking","If it consistently fails, suspect an X UI/markup change — update or report the library"],"exampleFix":"// before\nawait cli.run(['twitter', 'unblock', 'user']);\n// after\ntry {\n  await cli.run(['twitter', 'unblock', 'user']);\n} catch (e) {\n  if (e.code === 'TIMEOUT') console.warn('Unconfirmed — verify the profile manually before retrying');\n}","handlingStrategy":"try-catch","validationCode":"// preflight: ensure the profile page loads and you are logged in\nawait page.goto(`https://x.com/${username}`);\nif (await page.$('[data-testid=\"SideNav_AccountSwitcher_Button\"]') === null) {\n  throw new Error('Not logged in to x.com — log in before unblock');\n}","typeGuard":"function isTimeoutError(e) { return e && e.code === 'TIMEOUT'; }","tryCatchPattern":"try {\n  await cli.run(['twitter', 'unblock', user]);\n} catch (e) {\n  if (e.code === 'TIMEOUT' && /unblock confirmation/.test(e.message)) {\n    // DO NOT auto-retry: the write may have landed. Verify manually.\n    console.warn('Unconfirmed — check the profile before retrying');\n  } else throw e;\n}","preventionTips":["Never blind-retry after an unconfirmed write — verify the profile first","Run write commands on a stable connection with the page fully loaded","Keep the library updated since X markup changes break confirmation detection","Avoid invoking writes while other tabs/scripts hold the same session busy"],"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"}