{"record":{"id":"6b0f608b840cff2a","repo":"jackwener/OpenCLI","slug":"xianyu-publish-result-was-not-confirmed-before-tim","errorCode":null,"errorMessage":"Xianyu publish result was not confirmed before timeout","messagePattern":"Xianyu publish result was not confirmed before timeout","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/xianyu/publish.js","lineNumber":470,"sourceCode":"                itemId = String(result.item_id || '').replace(/\\D/g, '');\n                return [{\n                    status: 'published',\n                    item_id: itemId,\n                    title: data.title.slice(0, 50),\n                    price: `¥${data.price}`,\n                    condition: data.condition,\n                    url: result.url || finalUrl,\n                    message: '发布成功',\n                }];\n            }\n\n            if (result?.status === 'failed') {\n                failReason = result.message || '发布失败';\n                break;\n            }\n        }\n\n        throw new CommandExecutionError(failReason || 'Xianyu publish result was not confirmed before timeout', `Open ${finalUrl} and verify whether the listing was published.`);\n    },\n});\n\nexport const __test__ = {\n    CONDITION_CHOICES,\n    MAX_IMAGES,\n    validateImagePaths,\n    normalizePublishArgs,\n    buildPublishUrl,\n    getCurrentPageUrl,\n    buildFillFormEvaluate,\n    buildSelectCategoryEvaluate,\n    buildFindFileInputSelectorEvaluate,\n    buildDetectSuccessEvaluate,\n};\n","sourceCodeStart":452,"sourceCodeEnd":486,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/xianyu/publish.js#L452-L486","documentation":"Publish clicked submit, then polls buildDetectSuccessEvaluate() 10 times (1.5s apart) for status 'published' or 'failed'. If neither appears before the loop ends — and no explicit failure message was captured — the CLI throws this timeout error, advising you to open finalUrl and check manually. The listing may or may not have actually gone through.","triggerScenarios":"`xianyu publish` where ~15s of polling never yields status 'published' or 'failed': slow server-side processing, the success detector's DOM markers changed, or the page navigated somewhere the detector doesn't understand.","commonSituations":"Goofish under heavy load delaying listing creation past 15s; risk-control review holding the listing; front-end redesign breaking buildDetectSuccessEvaluate; upload still processing when the poll window expired.","solutions":["Open the finalUrl from the error hint and check manually whether the item was published; it may have succeeded after the timeout.","Simply retry the publish — check your listings first to avoid duplicates.","If timeouts are routine, increase the poll count/duration in the publish flow around clis/xianyu/publish.js:446-468.","Check for goofish risk-control notices (verification required) on the account."],"exampleFix":"// before: fixed 10 x 1.5s poll\nfor (let i = 0; i < 10; i++) { await page.wait(1.5); ... }\n// after: longer budget for slow publishes\nfor (let i = 0; i < 30; i++) { await page.wait(1.5); ... }","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  return await publish(data);\n} catch (e) {\n  if (String(e.message).includes('not confirmed before timeout')) {\n    const url = e.message.match(/Open (\\S+) and/)?.[1];\n    // check listings manually or via API before re-publishing to avoid duplicates\n    const published = await checkListingExists(url);\n    if (!published) return publish(data);\n  }\n  throw e;\n}","preventionTips":["Always open the finalUrl in the error hint to confirm outcome before retrying.","Don't blindly retry — dedupe against existing listings first.","Under persistent timeouts, lengthen the poll loop (clis/xianyu/publish.js:446).","Watch for account risk-control states that delay or hold listings."],"tags":["timeout","polling","browser-automation","xianyu"],"backgroundTag":"operation-timed-out","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}