Skip to content

fix(route/zsxq): preserve topic ID precision - #22836

Open
gbcdef wants to merge 1 commit into
DIYgod:masterfrom
gbcdef:codex/fix-zsxq-topic-id-precision
Open

fix(route/zsxq): preserve topic ID precision#22836
gbcdef wants to merge 1 commit into
DIYgod:masterfrom
gbcdef:codex/fix-zsxq-topic-id-precision

Conversation

@gbcdef

@gbcdef gbcdef commented Jul 26, 2026

Copy link
Copy Markdown

Involved Issue / 该 PR 相关 Issue

N/A

Example for the Proposed Route(s) / 路由地址示例

/zsxq/group/88855458825252
/zsxq/user/2414218251

New RSS Route Checklist / 新 RSS 路由检查表

  • New Route / 新的路由
  • Anti-bot or rate limit / 反爬/频率限制
    • If yes, do your code reflect this sign? / 如果有, 是否有对应的措施?
  • Date and time / 日期和时间
    • Parsed / 可以解析
    • Correct time zone / 时区正确
  • New package added / 添加了新的包
  • Puppeteer

Note / 说明

Knowledge Planet returns 17-digit topic_id values as JSON numbers. The default JavaScript parser rounds values beyond Number.MAX_SAFE_INTEGER, which corrupts feed item links and GUIDs.

This change parses the raw ZSXQ response with the existing json-bigint dependency and stores large integers as strings, preserving exact topic links. It also adds a regression test for 55522458445228254 and corrects the topics response type.

Validation:

  • pnpm vitest run lib/utils/got.test.ts
  • targeted Oxfmt, Oxlint, and ESLint checks
  • pnpm build:routes

@github-actions

Copy link
Copy Markdown
Contributor

Auto Review

Code Style and Maintainability (rule 26: avoid unnecessary changes outside PR scope)

  • lib/utils/got.test.ts: the new describe('zsxq response parsing') block tests route code (@/routes/zsxq/utils), not the got utility, and pulls route-specific imports (customFetch, generateTopicDataItem, TopicsResponse) into a core-utils test file. Fix: move the new block into a new lib/routes/zsxq/utils.test.ts and revert lib/utils/got.test.ts to its original content.

The json-bigint parsing change in lib/routes/zsxq/utils.ts and the ResponseData / topic_id type corrections in lib/routes/zsxq/types.ts look correct — got's parseResponse does expose the raw text via response.body, and json-bigint is already a project dependency.

@github-actions

Copy link
Copy Markdown
Contributor

Successfully generated as following:

http://localhost:1200/zsxq/group/88855458825252 - Failed ❌
HTTPError: Response code 503 (Service Unavailable)

Error Message:<br/>ConfigNotFoundError: 该 RSS 源由于配置不正确而被禁用:令牌丢失。
Route: /zsxq/group/:id/:scope?
Full Route: /zsxq/group/88855458825252
Node Version: v24.18.0
Git Hash: c6566e89
http://localhost:1200/zsxq/user/2414218251 - Failed ❌
HTTPError: Response code 503 (Service Unavailable)

Error Message:<br/>ConfigNotFoundError: 该 RSS 源由于配置不正确而被禁用:令牌丢失。
Route: /zsxq/user/:id
Full Route: /zsxq/user/2414218251
Node Version: v24.18.0
Git Hash: c6566e89

@github-actions github-actions Bot added the auto: not ready to review Users can't get the RSS feed output according to automated testing results label Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto: not ready to review Users can't get the RSS feed output according to automated testing results core enhancement route

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant