{"record":{"id":"36f1a4c49d2e7af7","repo":"jackwener/OpenCLI","slug":"instagram-post-share-confirmation-did-not-appear","errorCode":null,"errorMessage":"Instagram post share confirmation did not appear","messagePattern":"Instagram post share confirmation did not appear","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/instagram/post.js","lineNumber":1265,"sourceCode":"            throw new CommandExecutionError('Instagram post share failed', 'Inspect /tmp/instagram_post_share_debug.png for the share failure state');\n        }\n        if (result?.ok) {\n            return result.url || '';\n        }\n        if (result?.settled) {\n            settledStreak += 1;\n            if (settledStreak >= 3)\n                return '';\n        }\n        else {\n            settledStreak = 0;\n        }\n        if (attempt < 89) {\n            await page.wait({ time: 1 });\n        }\n    }\n    await page.screenshot({ path: '/tmp/instagram_post_share_debug.png' });\n    throw new CommandExecutionError('Instagram post share confirmation did not appear', 'Inspect /tmp/instagram_post_share_debug.png for the final publish state');\n}\nasync function resolveProfileUrl(page, currentUserId = '') {\n    if (currentUserId) {\n        const runtimeInfo = await resolveInstagramRuntimeInfo(page);\n        const apiResult = await page.evaluate(`\n      (async () => {\n        const userId = ${JSON.stringify(currentUserId)};\n        const appId = ${JSON.stringify(runtimeInfo.appId || '')};\n        try {\n          const res = await fetch(\n            'https://www.instagram.com/api/v1/users/' + encodeURIComponent(userId) + '/info/',\n            {\n              credentials: 'include',\n              headers: appId ? { 'X-IG-App-ID': appId } : {},\n            },\n          );\n          if (!res.ok) return { ok: false };\n          const data = await res.json();","sourceCodeStart":1247,"sourceCodeEnd":1283,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/instagram/post.js#L1247-L1283","documentation":"Thrown by waitForPublishSuccess when the probe never reports ok/failed/settled within the 90-iteration (~90 second) polling window. The CLI cannot confirm the post published; a final-state screenshot is saved before throwing.","triggerScenarios":"clis/instagram/post.js share click succeeded but the success confirmation (post URL / dialog) never appeared within 90 seconds of 1-second polls — slow upload, page navigated away, dialog markup changed, or publish silently stalled.","commonSituations":"Very large video uploads exceeding the 90s budget; Instagram A/B UI change that hides the confirmation element the probe looks for; a modal (e.g. 'Save your info') intercepting the flow; session degraded so publish hangs.","solutions":["Inspect /tmp/instagram_post_share_debug.png to see what state the composer ended in","Check whether the post actually went live by listing recent profile posts before retrying (avoid duplicates)","Retry with smaller/compressed media or fewer items to fit the polling window","Update the CLI / probe selectors if Instagram changed its composer markup","Dismiss interfering dialogs (login challenges, save-info prompts) in the session before posting"],"exampleFix":"// before\nthrow new CommandExecutionError('Instagram post share confirmation did not appear', hint);\n// after: check if the post actually landed before treating it as a failure\nconst existing = await captureExistingProfilePostPaths(page);\nif (existing.length > baselineCount) {\n  return existing[0];\n}\nthrow new CommandExecutionError('Instagram post share confirmation did not appear', hint);","handlingStrategy":"try-catch","validationCode":"// Confirm the session is healthy and no blocking modal is present before starting the share\nconst sessionOk = await page.evaluate(`!!document.querySelector('a[href$=\"/\"]') && !document.querySelector('div[role=\"dialog\"]')`);\nif (!sessionOk) throw new Error('Instagram session or page state not ready for posting');","typeGuard":"function isConfirmedPublish(result) {\n  return result !== null && typeof result === 'object' && typeof result.url === 'string' && result.url.length > 0;\n}","tryCatchPattern":"try {\n  await postToInstagram(media, caption);\n} catch (e) {\n  if (e instanceof CommandExecutionError && /confirmation did not appear/.test(e.message)) {\n    // the post may still have landed — check profile posts before retrying to avoid duplicates\n    const posts = await listRecentProfilePosts();\n    if (posts.some((p) => p.caption === caption)) return;\n    throw e;\n  }\n  throw e;\n}","preventionTips":["Use smaller/compressed media so uploads finish well inside the 90s polling window","Dismiss any startup modals (save-info prompts, challenges) before invoking the post command","Keep the CLI updated so publish-probe selectors track Instagram UI changes","Verify a post did not silently succeed before blindly retrying (duplicate-post risk)"],"tags":["instagram","timeout","automation","publish-confirmation"],"backgroundTag":"publish-timeout","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}