{"record":{"id":"27e57440edb29681","repo":"jackwener/OpenCLI","slug":"waiting-for-taobao-tracknick-cookie","errorCode":null,"errorMessage":"Waiting for Taobao tracknick cookie","messagePattern":"Waiting for Taobao tracknick cookie","errorType":"exception","errorClass":"AuthRequiredError","httpStatus":null,"severity":"info","filePath":"clis/taobao/auth.js","lineNumber":54,"sourceCode":"    decodedTracknick = tracknick;\n  }\n  const nickname = domInfo.nickname || decodedTracknick;\n  if (!domInfo.user_id) {\n    throw new CommandExecutionError('Taobao my_itaobao rendered but no user_id extractable — stale cookie2 or layout drift');\n  }\n  return { user_id: String(domInfo.user_id), nickname: String(nickname) };\n}\n\nregisterSiteAuthCommands({\n  site: 'taobao',\n  domain: 'taobao.com',\n  loginUrl: 'https://login.taobao.com/member/login.jhtml',\n  columns: ['user_id', 'nickname'],\n  quickCheck: hasTaobaoSessionCookie,\n  verify: verifyTaobaoIdentity,\n  poll: async (page) => {\n    if (!await hasTaobaoSessionCookie(page)) {\n      throw new AuthRequiredError('taobao.com', 'Waiting for Taobao tracknick cookie');\n    }\n    return verifyTaobaoIdentity(page);\n  },\n});\n","sourceCodeStart":36,"sourceCodeEnd":59,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/taobao/auth.js#L36-L59","documentation":"The taobao auth registration's poll() callback throws AuthRequiredError with this message whenever hasTaobaoSessionCookie(page) is false during the login-completion polling loop. It is an expected control-flow signal telling the CLI 'keep waiting, the user hasn't finished logging in yet'.","triggerScenarios":"Any poll tick of the taobao login flow (loginUrl https://login.taobao.com/member/login.jhtml) where the quick-check hasTaobaoSessionCookie finds no tracknick/session cookie yet — i.e., before the user completes login.","commonSituations":"User hasn't typed credentials yet during interactive login; slider captcha blocking login; user scanned QR but Taobao hasn't set cookies; polling started against a fresh context.","solutions":["Wait — this error is expected until login completes; keep polling until it stops throwing","Complete the login in the browser window (credentials/captcha/QR scan)","If it persists after successful login, verify cookies land on the taobao.com domain (devtools check)","Restart the login flow with a clean context if the page is stuck in a captcha loop"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const ready = await hasTaobaoSessionCookie(page);\nif (!ready) console.log('Login not complete yet — waiting...');","typeGuard":null,"tryCatchPattern":"try {\n  const identity = await pollTaobaoAuth(page);\n} catch (e) {\n  if (e instanceof AuthRequiredError && /Waiting for Taobao tracknick/.test(e.message)) {\n    // expected: keep waiting for the user to finish login\n    return scheduleRetry(page);\n  }\n  throw e;\n}","preventionTips":["Only treat this as an error if polling exceeded a timeout budget","Prompt the user to complete login (including captcha) before/while polling","Use waitForFunction on a session-cookie presence check instead of fixed-interval polling"],"tags":["auth","polling","taobao","login-flow"],"backgroundTag":"login-poll-pending","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}