pot-app/pot-desktop · error · Error
Can not find status: ${JSON.stringify(result)}
Error message
Can not find status: ${JSON.stringify(result)} What it means
The status() helper polls https://openapi.alipan.com/oauth/qrcode/{sid}/status while the user scans the login QR code. If the response is HTTP-ok but the body has no `status` field, the code throws `Can not find status: <body JSON>`. It indicates the API returned 200 with an unexpected payload shape.
Source
Thrown at src/window/Config/pages/Backup/utils/aliyun.jsx:128
} else {
const result = res.data;
if (result['message']) {
throw new Error(result['message']);
} else {
throw new Error(`Get QrCode Error: ${JSON.stringify(result)}`);
}
}
}
export async function status(sid) {
const res = await fetch(`https://openapi.alipan.com/oauth/qrcode/${sid}/status`);
if (res.ok) {
const result = res.data;
if (result['status']) {
return { status: result['status'], code: result['authCode'] };
} else {
throw new Error(`Can not find status: ${JSON.stringify(result)}`);
}
} else {
const result = res.data;
if (result['message']) {
throw new Error(result['message']);
} else {
throw new Error(`Get Status Error: ${JSON.stringify(result)}`);
}
}
}
export async function userInfo(token) {
const res = await fetch('https://openapi.alipan.com/oauth/users/info', {
headers: {
Authorization: `Bearer ${token}`,
},
});
if (res.ok) {View on GitHub (pinned to 594d32ede9)
Solutions
- Log the JSON in the error to see what the endpoint actually returned.
- Re-run qrcode() to obtain a fresh sid and restart the login flow when the session is expired.
- Treat this as 'session expired/invalid' in the polling loop and stop polling instead of crashing.
- Check for Alipan OAuth API schema changes and update field expectations.
Example fix
// before
if (result['status']) {
return { status: result['status'], code: result['authCode'] };
} else {
throw new Error(`Can not find status: ${JSON.stringify(result)}`);
}
// after
if (result && typeof result.status === 'string') {
return { status: result.status, code: result.authCode };
}
return { status: 'expired' }; // treat missing status as expired session, refresh sid via qrcode() Defensive patterns
Strategy: validation
Validate before calling
// validate the poll result before trusting it
function hasStatus(data) {
return data && typeof data === 'object' && typeof data.status === 'string' && data.status.length > 0;
}
// use: if (hasStatus(res.data)) { ... } else { regenerate sid via qrcode() } Type guard
function isQrStatusResponse(r) {
return r && typeof r === 'object' && typeof r.status === 'string';
} Try / catch
try {
const { status, code } = await status(sid);
if (status === 'LoginSuccess') finishLogin(code);
} catch (e) {
if (String(e.message).startsWith('Can not find status')) {
// missing status field = expired/invalid session — stop polling, get new QR
stopPolling();
restartQrLogin();
}
} Prevention
- Bound the polling loop (e.g. max 2 minutes) and regenerate the sid on any anomaly
- Treat a missing `status` field as 'session expired', not a crash
- Re-fetch the QR code rather than reusing an old sid
- Monitor Alipan OAuth API changelogs for schema changes
When it happens
Trigger: Calling status(sid) with an HTTP 200 response whose res.data lacks `status` — e.g. an expired/invalid sid returning an empty or error-shaped object, or the endpoint's response schema changing.
Common situations: Polling with a stale sid after the QR session expired; the QR session was consumed/cancelled and the API returns a 200 with no status; a version change of the Alipan OAuth API that renamed the `status` field.
Related errors
- Can not find avatar or name: ${JSON.stringify(result)}
- Get QrCode Error: ${JSON.stringify(result)}
- Get Status Error: ${JSON.stringify(result)}
- Get UserInfo Error: ${JSON.stringify(result)}
- Can not find access_token: ${JSON.stringify(result)}
AI-assisted analysis of pot-app/pot-desktop@594d32ede9 (2026-09-02).
Data as JSON: /api/errors/50f403b4d70e6128.
Report an issue: GitHub.