Repository navigation
Cover the invite-link join path at the network boundary (#30) - #37
Merged
Merged
Conversation
parseJoinCode has unit tests, but nothing asserted the thing that actually
broke: what the app puts on the wire. Before the fix, handing the app an
invite link (which is exactly what the QR carries) sent
{"code":"https://inventory.scuttle.dev/join/ABCD-2345"} to POST
/households/join, which matches join_code exactly and so 404'd on every
scanned invite.
This drives the real join UI with an invite link and asserts the request
body carries the bare ABCD-2345 — it fails against the pre-fix ViewModel
with the exact reported error, and passes on the current code.
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.
Fixes #30
The fix for #30 already landed in
c5d66a4(parseJoinCode, onmainsince earlier today) — the issue just never got linked to it, so it stayed open. This PR verifies that fix and leaves a regression test behind, which closes the issue.Verifying the fix
parseJoinCodehas good unit coverage, but nothing asserted the thing that actually broke: what the app puts on the wire. So I drove the real join UI on a Pixel 7 Pro against a mocked backend, handing it exactly what the invite QR carries, and read the outgoing request.With the pre-fix ViewModel, the app sends:
{"code":"https://inventory.scuttle.dev/join/ABCD-2345"}POST /households/joinmatchesjoin_codeexactly, so that 404s — which is precisely the "could not be found" error the tester screenshotted. On currentmainthe same flow sendsABCD-2345and the UI reaches "Joined successfully!".So the bug is genuinely fixed, and this test now fails if it ever regresses.
What I could not drive
The tester's path starts at the camera, and I can't feed a QR frame to the scanner in an instrumented test. What I verified is the code path from "app is handed the link" onward, which is where the bug was — the scanner (
onCodeScanned) and the pasted/typed path both funnel throughparseJoinCode, andjoin()parses again before the call. The camera capture itself is unverified by automation.Worth a quick two-phone sanity check whenever the next build goes out to testers, since that last hop is the one I can't cover.
Note on shipping
The fix is on
mainbut not in any build the testers have — they're on v0.1.6, and the release is on hold. Closing this issue does not mean the tester's phone is fixed yet; it'll reach them with the next build.Full suite green: 42/42 instrumented, 124/124 unit, ktlint + detekt clean.