{"record":{"id":"689dc07ee2638d98","repo":"jackwener/OpenCLI","slug":"jike-topic-returned-an-unreadable-payload","errorCode":null,"errorMessage":"Jike topic returned an unreadable payload","messagePattern":"Jike topic returned an unreadable payload","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/jike/topic.js","lineNumber":63,"sourceCode":"            if (data.length === 0) {\n                throw new EmptyResultError('jike topic', `No posts were returned for topic ${args.id}. Confirm the topic ID and login state.`);\n            }\n            return data.slice(0, limit).map((item) => ({\n                content: item.content ?? '',\n                author: item.author ?? '',\n                likes: item.likes ?? 0,\n                comments: item.comments ?? 0,\n                time: item.time ?? '',\n                url: `https://web.okjike.com/originalPost/${item.id ?? ''}`,\n            }));\n        }\n        if (data?.reason === 'missing-data-script') {\n            throw new CommandExecutionError('Jike topic page did not expose the expected data script');\n        }\n        if (data?.reason === 'parse-error') {\n            throw new CommandExecutionError(`Failed to parse Jike topic data: ${data.message || 'unknown error'}`);\n        }\n        throw new CommandExecutionError('Jike topic returned an unreadable payload');\n    },\n});\n","sourceCodeStart":45,"sourceCodeEnd":66,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/jike/topic.js#L45-L66","documentation":"Final fallback in the topic CLI: if the evaluate result is neither an Array nor carries a recognized reason ('missing-data-script' / 'parse-error'), the payload shape is entirely unrecognized and a generic CommandExecutionError is thrown. It covers any future change where the in-page script returns an unexpected object.","triggerScenarios":"data is a non-array, non-{reason:...} object — e.g. the evaluate returned null/undefined, an exception value, or Jike's page contract changed so the script returns a new object shape.","commonSituations":"Jike front-end rewrite changing the return contract of the embedded data; sandbox/evaluate serialization quirks returning undefined; content-security or bot mitigations altering page execution.","solutions":["Update the CLI/package to match the current Jike page contract.","Inspect the raw evaluate output (add a temporary console.log of data) to see the new shape.","Retry later — a transient page anomaly may resolve on reload.","Open the topic URL in a browser to confirm the page still renders posts normally."],"exampleFix":"// before\nthrow new CommandExecutionError('Jike topic returned an unreadable payload');\n// after: include the payload for diagnosis\nthrow new CommandExecutionError(`Jike topic returned an unreadable payload: ${JSON.stringify(data)?.slice(0, 200)}`);","handlingStrategy":"try-catch","validationCode":"// validate the evaluate result shape before consuming it\nconst shaped = Array.isArray(data) || (data && typeof data === 'object' && 'reason' in data);","typeGuard":"const isTopicPayload = (d) => Array.isArray(d) || (d != null && typeof d === 'object' && typeof d.reason === 'string');","tryCatchPattern":"try {\n  return await runCli(['jike', 'topic', id]);\n} catch (e) {\n  if (/unreadable payload/.test(e.message)) {\n    console.error('Jike topic page contract changed; update CLI');\n    return [];\n  }\n  throw e;\n}","preventionTips":["Update the CLI package when Jike changes its page/data contract.","Log the unexpected evaluate output to identify the new shape quickly.","Treat this error as a schema-drift signal, not a user mistake."],"tags":["scraping","jike","schema-drift"],"backgroundTag":"malformed-api-response","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}