Repository navigation
iPhone: retire Approve Requests and Stop Approving (#342) - #354
Merged
Merged
Conversation
Pairing makes the iPhone an approver (ADR 0014, amended by #336), so the iPhone app drops the approver confirmation flow (ApproverConfirmationFlow, startApproverConfirmation, confirmApprover, confirmationSaved and its screen), Stop Approving for This Mac, the outbox's confirmation purpose and revocationCount, whose only reader was confirmationSaved. Mac detail shows a status line, Rename and Remove. A Mac paired before #336 without the flag says to remove it and pair again, and only such a row is marked on the list. Remove's confirmation says this iPhone stops at once, drops the pending requests and tells the Mac, which stops trusting the iPhone only when it processes the unpair notice. A removal whose list write fails is reported on the detail screen. Tests replace Stop Approving with removal in the race tests and cover the status, re-pairing a Mac without the flag and a failed removal. Renders add the Mac detail states and the removal confirmation and drop the approver screens.
Cross review of #354 found that removeMac revoked the pairing only in the removal hook, after the messenger's list reads, so a stored decision due for resend could still leave in between. removeMac now revokes the pairing and drops its requests before the first suspension, as the retired Stop Approving did; the hook does the same again. - Remove's confirmation says the Mac stops trusting this iPhone only when it receives the unpair notice, and that an earlier decision can apply until then. - Mac rows reflect an in-process revocation, so a removal whose list write failed no longer shows the Mac as approving. - removeMac returns whether the Mac was removed; the detail screen no longer reads the shared list notice, and a failed removal no longer hides a later unpair notice from that Mac. - Tests for the early revocation, unsent receipts on removal, the failed removal's status, and the Chinese table's retired term.
Cross adversarial review (#342)Reviewers: GPT-6 Astra (xhigh) and Opus 5.5 (xhigh), read-only, two rounds each (round 2: each ruled on the other's report). Baseline e5ed7c0. Neither found a P0, any remnant of the approver code, approver confirmation or Stop Approving path, authority for an entry without the flag, or a claim that a fake Mac on the list is genuine. Fixed in b778f99
Declined
Review directories deleted. |
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.
Closes #342
Summary
Pairing makes the iPhone an approver (ADR 0014, amendment for #336), so the iPhone app retires Approve Requests from This Mac, Enter a New Approval Code and Stop Approving for This Mac. Removed:
ApproverConfirmationFlow,ApproverProblem,startApproverConfirmation,closeApproverConfirmation,confirmApprover,confirmationSaved,stopApproving,approverConfirmation, the outbox's confirmation purpose (OutgoingMessagenow carries only a receipt's request),revocationCount(its only reader wasconfirmationSaved),Views/ApproverConfirmationView.swift, and theapprover.*,mac.approve*,mac.stop*andlist.approverstrings (22 keys).Mac detail now shows a status line, Rename and Remove. A flagged Mac says this iPhone can approve agents' requests to use credentials on it; an entry without the flag (a pre-#336 pairing) says to remove the Mac and pair it again, and only such a row is marked on the list. Remove's confirmation says this iPhone stops at once, drops the pending requests and tells the Mac, which stops trusting this iPhone only when it next checks, so ending approval on the Mac at once means removing the iPhone there too (decision 3).
removeMacnow revokes the pairing and drops its requests, decisions, receipts and notifications before its first suspension, as the retired Stop Approving did (the removal hook does it again before the list write), and returns whether the Mac was removed. A Mac whose removal failed shows as not approving until it is removed or the app restarts, and the detail screen, which stays open, says the removal failed.The
.confirmationarm ofhandleApprovalstays: kind 14 andApprovalMessage.confirmationare #343's.Strings (maintainer approves the wording from the renders)
mac.status.approving(changed)mac.status.notApproving(changed)list.remove.confirmMessage(changed)list.notApprover(new)Renders (
askkey-ios-screens, each-enand-zh-Hans)34-mac-detail-approving35-mac-detail-without-approval-flag36-mac-detail-remove-confirmation: iOS drawsconfirmationDialogitself andImageRenderercannot capture it, so the test lays out the dialog's own texts (MacRemovalText, shared with the real dialog) as an action sheet over the detail screen.37-mac-detail-rename-and-removal-failed(a failed removal leaves the entry, which this process refuses)11-paired-macs-one-macand12-paired-macs-reached(flagged rows, unmarked),15-requests-home(the second Mac has no flag and is the only marked row).34-mac-detail-not-approving,35-mac-detail-approving,36–39-approver-confirmation*.Diff stat
20 files changed, 323 insertions(+), 924 deletions(-), all under
iOS/AskKeyiOSKitandiOS/AskKeyiOSKitTests; the catalog accounts for most of the deletions.Tests
bash scripts/build-ios.sh test(local, iPhone simulator, head b778f99): AskKeyiOSKitTests 163 passed, 0 failed (main after #341: 163); AskKeyiOSNotificationServiceTests 44 passed, 0 failed; 88 screens rendered (main: 92). With the early revocation inremoveMacremoved,testRemovalStopsThisIPhoneBeforeTheMessengerReadsTheListfails (the stored decision is sent again), so the test covers the fix.testStopApprovingClearsTheFlagAndDropsTheMacsCardsinApproverTests;testStopApprovingReportsAFlagThatCouldNotBeClearedandtestAnAccountChangeWhileAConfirmationIsSendingResetsTheSheetinApprovalRaceTests; plusScreenRenderTests.testApproverConfirmation.ApprovalRaceTests.testRemovalStopsThisIPhoneBeforeTheMessengerReadsTheList,testRemovingTheMacDropsItsUnsentReceipts;ApproverTests.testPairingIsAllItTakesToApproveTheMacsRequests,testAMacPairedBeforeTheRuleWithoutApprovalIsMarkedAndRefused,testPairingAMacWithoutTheFlagAgainMakesThisIPhoneApproveIt,testRemovingTheMacStopsThisIPhoneAtOnceAndTellsTheMac(the Mac keeps its entry until it polls the unpair notice),testARemovalWhoseListWriteFailsStillStopsThisIPhone(stored request, notification, the row's status, retry);LocalizationTests.testNoRetiredApproverStringRemains(both tables).ApprovalRaceTests.testRemovingTheMacDuringASendKeepsTheNextStoredDecisionFromLeaving,ApprovalDecisionTests.testAMacRemovedDuringThePromptGetsNothing,OpenedRequestTests.testARequestFromARemovedMacShowsUnavailableandtestRemovingTheMacDuringTheFetchKeepsTheRequestFromBecomingACard.TestWorld.approveMac,pairAndApproveandapproverCodeare gone; tests rely on pairing.TestWorld.storeWithoutApprovalFlag(_:)stays for the tests of a Mac without the flag (ApprovalRequestTests,OpenedRequestTests,ApproverTests); its calls inApproverTests.setUpare gone.Checks
python3 scripts/check_hygiene.py: passed (size=0, test-support=0, debug=0, local-path=0, non-ascii-name=0, multica=0, cjk=0).build-ios.shpassed; a scan finds no catalog key unused by the kit's sources.Deviations and questions
App/AppStates.swift(doc comment ofPairedMacRow.isApprover) andFakes/TestWorld.swift(a comment) are touched beyond the ADR's file list; both are comment-only.mac.stop.failedand reuseslist.notice.removalFailed.removeMacrevokes before it waits and returns its outcome, and rows reflect an in-process revocation (see the review comment).AskKeyDevices(AskKeyDevices: reserve kind 14 and remove the approver code #343), the extension'sNotificationProcessor.swift, and the tabs (Give the iPhone app Requests, History and Macs tabs #346).