Fix broken query strings in three methods - #11
Open
FrankBStack wants to merge 2 commits into
Open
FrankBStack wants to merge 2 commits into
FrankBStack wants to merge 2 commits into
Conversation
getUserContent, viewPollResults and getGroupChats were building URLs like /v1/posts&type=my_posts, using & instead of ? for the first query parameter. Since & is a valid path character the server received a route that does not exist and every call to these methods failed. The latter two regressed in 2.6.6 when cacheBust was added. Adds a unit test suite (node --test, no dependencies) that stubs fetch and asserts on the exact URL, method, headers and body each method sends, so this class of bug is caught without a live token. Wired up as `npm test`. Also fixes updatesTest.js, which was passing the client instance itself as the group ID, and rebuilds dist.
This branch has not been deployed
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.
Three of the client methods were building their query string with
&instead of?, sogetUserContent,viewPollResultsandgetGroupChatswere requesting paths like/v1/posts&type=my_postsand failing every time. Two of them broke in 2.6.6 when cacheBust got added,getUserContenthas been that way for a while.Fixed the three urls and rebuilt dist. Also added some unit tests that stub fetch and check what each method actually sends, since the existing test scripts all need a real token. They run with
npm test, no new deps, and there's a small workflow so they run on PRs.This is the small part pulled out of #10. That one's the refactor on top of this and can wait.