Repository navigation
fix(ios): pair from one iPhone with a code, link or QR picture - #90
Conversation
Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 62c2276d93
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| public func cancel() { | ||
| codeAttempt += 1 |
There was a problem hiding this comment.
Actually cancel in-flight code redemption
When Cancel is tapped while codeBusy, incrementing codeAttempt only causes the eventual response to be ignored; it does not cancel the unstructured Task launched by PairView or its URL request. If the POST reaches the box, the single-use code can be consumed and its returned enrollment link discarded, so the next attempt reports an expired/used code and forces the user to generate another one. Disable Cancel during redemption or retain and cancel the task with semantics that avoid abandoning a redeemed code.
Useful? React with 👍 / 👎.
An owner with only an iPhone cannot scan the QR shown in Safari on that phone. Pairing now offers Enter pairing code, accepts a pasted code with the box address or a full pairing link, and reads a QR picture from Photos on a real iPhone as well as in the simulator.
Paired with srcfl/ftw#1721. The eight-character code is exchanged directly with the box on the home Wi-Fi. The app asks for the house password on 401, keeps it only for the attempt, refuses public targets and redirects, and stores no HTTP cookies or credentials. The returned v3 link follows the existing enrollment and pinned Noise path. QR pictures and pasted full links keep working with boxes that already supply a v3 QR.
The code form has Swedish and English text, visible field labels and help behind How. Local Network permission explains the setup exchange in both languages. No local session or new cloud lookup is added.
Validation:
swift test: 547 passed, including a new phone reaching a simulated home after the code exchange, password refusal, address checks and the existing Go-generated v3 vector.Human UI review and the permission/link flow on a physical iPhone remain. This PR does not upload a TestFlight build.