Skip to content

Cover the invite-link join path at the network boundary (#30) - #37

Merged
spdotdev merged 1 commit into
mainfrom
test/30-join-invite-link
Jul 12, 2026
Merged

spdotdev merged 1 commit into
mainfrom
test/30-join-invite-link

Conversation

@spdotdev

Copy link
Copy Markdown
Owner

Fixes #30

The fix for #30 already landed in c5d66a4 (parseJoinCode, on main since 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

parseJoinCode has 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/join matches join_code exactly, so that 404s — which is precisely the "could not be found" error the tester screenshotted. On current main the same flow sends ABCD-2345 and 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 through parseJoinCode, and join() 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 main but 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.

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.
@spdotdev spdotdev self-assigned this Jul 12, 2026
@spdotdev spdotdev added the enhancement New feature or request label Jul 12, 2026
@spdotdev
spdotdev merged commit f60aa56 into main Jul 12, 2026
2 checks passed
@spdotdev
spdotdev deleted the test/30-join-invite-link branch July 12, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Share households through QRcode

1 participant