Skip to content

fix(ios): pair from one iPhone with a code, link or QR picture - #90

Merged
frahlg merged 1 commit into
mainfrom
codex/iphone-pair-code
Oct 18, 2026
Merged

frahlg merged 1 commit into
mainfrom
codex/iphone-pair-code

Conversation

@frahlg

@frahlg frahlg commented Oct 18, 2026

Copy link
Copy Markdown
Member

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.
  • Xcode build and 3 UI tests passed on iPhone 17 Pro, iOS 26.5 Simulator: light, dark and the largest accessibility text size. Screenshots inspected; code, picture choice, invalid input and cancel checked.
  • Simulator logs for three unpaired launches showed first frame at 927, 875 and 878 ms after process start. These are simulator measurements.

Human UI review and the permission/link flow on a physical iPhone remain. This PR does not upload a TestFlight build.

Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T06:32:51.250656Z 62c2276 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@frahlg
frahlg merged commit b7f80ef into main Oct 18, 2026
1 check passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant