{"record":{"id":"4768afb7c10c03a6","repo":"jackwener/OpenCLI","slug":"twitter-like-confirmation","errorCode":null,"errorMessage":"twitter like confirmation","messagePattern":"twitter like confirmation","errorType":"exception","errorClass":"TimeoutError","httpStatus":null,"severity":"warning","filePath":"clis/twitter/like.js","lineNumber":74,"sourceCode":"            // Click Like\n            writeStarted = true;\n            likeBtn.click();\n            await new Promise(r => setTimeout(r, 1000));\n\n            // Verify success by checking if the 'unlike' button reappeared\n            const verifyArticle = findTargetArticle() || targetArticle;\n            const verifyBtn = verifyArticle?.querySelector('[data-testid=\"unlike\"]');\n            if (verifyBtn) {\n                return { ok: true, message: 'Tweet successfully liked.' };\n            } else {\n                return { ok: false, unconfirmed: true, message: 'Like action was initiated but UI did not update as expected.' };\n            }\n        } catch (e) {\n            return { ok: false, unconfirmed: writeStarted, message: e.toString() };\n        }\n    })()`);\n        if (result.unconfirmed) {\n            throw new TimeoutError('twitter like confirmation', 1, `${result.message} Check the tweet before retrying; the like 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":56,"sourceCodeEnd":86,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/twitter/like.js#L56-L86","documentation":"This TimeoutError is thrown when the like write was started inside the page (writeStarted=true) but the confirmation result never came back — the in-page evaluate threw after beginning the action. Because the like may actually have been applied, the error message tells the user to check the tweet before retrying to avoid double-liking or a confusing state.","triggerScenarios":"During `twitter like`, the page.evaluate IIFE set writeStarted=true (clicked the like control) but then threw (catch branch returns {ok:false, unconfirmed:true, message}), so result.unconfirmed is truthy at like.js:74.","commonSituations":"Twitter UI re-rendered or navigated mid-click, causing the confirmation selector lookup to time out or throw; slow network so the liked state never rendered; an element detached right after the click; Twitter returned an unexpected toast/overlay that broke the confirmation logic.","solutions":["Open the tweet in the browser and check whether the like was actually applied before doing anything","If the tweet is already liked, do not retry — the action succeeded","If not liked, simply re-run `twitter like`","Retry when the network/page is more stable; increase wait budgets if the library allows","Update the library if Twitter's DOM changed"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await clis.twitter.like.func(page, { url });\n} catch (e) {\n  if (e instanceof TimeoutError || /confirmation/.test(e.message)) {\n    // side effect may have applied: check the tweet's liked state before retrying\n    const liked = await checkTweetLiked(page, url);\n    if (!liked) await clis.twitter.like.func(page, { url });\n  } else throw e;\n}","preventionTips":["Never blind-retry after a confirmation timeout — the like may have applied","Check the tweet's state in the browser before re-running","Run on a stable network to avoid mid-click timeouts","Avoid navigating or closing the page while the like is in flight"],"tags":["twitter","timeout","side-effects-uncertain"],"backgroundTag":"action-timeout-side-effect-uncertain","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}