fix(zsxq): accept topic_id as string in getTopicFromResponse#963
Merged
jackwener merged 2 commits intojackwener:mainfrom Apr 11, 2026
Merged
fix(zsxq): accept topic_id as string in getTopicFromResponse#963jackwener merged 2 commits intojackwener:mainfrom
jackwener merged 2 commits intojackwener:mainfrom
Conversation
The ZSXQ API returns topic_id as a string, but getTopicFromResponse() only checked for typeof === 'number', causing it to fall through and return null. This made 'opencli zsxq topic <id>' fail with NOT_FOUND for all valid topic IDs.
Contributor
|
This looks good to me. The change is small, the bug report matches the diff, and I did not spot a regression risk from this patch. |
…/{id}
The ZSXQ API requires topics to be fetched within their group context.
Change /v2/topics/{id} -> /v2/groups/{groupId}/topics/{id} for both
the detail and comments endpoints. Also adds optional --group_id arg.
jackwener
added a commit
that referenced
this pull request
Apr 11, 2026
The test mock was missing the evaluate call for getActiveGroupId, which was added when #963 introduced the group_id parameter.
2 tasks
jackwener
added a commit
that referenced
this pull request
Apr 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
opencli zsxq topic <id>returns "topic_idas a string, butgetTopicFromResponse()only checked fortypeof === 'number'.Fix
Extend the type guard in
getTopicFromResponse()to also accept strings:This allows the function to correctly recognize topics when the API returns
topic_idas a string (e.g.,"22255514214444820").Testing
Confirmed the bug exists in v1.7.0. Fix compiled and tested locally against the actual API response structure.