fix: fail open on undetermined contacts auth#136
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 1, 2026, 5:54 PM ET / 21:54 UTC. Summary Reproducibility: yes. from source inspection: current main awaits Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Add an internal nonprompting Contacts resolver mode for optional read-path enrichment, while preserving an authorization/request path for explicit contact-name resolution flows. Do we have a high-confidence way to reproduce the issue? Yes, from source inspection: current main awaits Is this the best way to solve the issue? No. The fail-open direction is right for optional read enrichment, but applying it inside the shared resolver is broader than the reported bug and removes the authorization path for contact-name resolution. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 3eb6f414ab73. Label changesLabel changes:
Label justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
@clawsweeper re-review Pushed maintainer fixup at What changed since the blocked review:
Local proof: |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Summary
Avoid hanging
imsg chatsandimsg historywhen Contacts authorization is still.notDeterminedin CLI usage.Root cause
ContactResolver.create()awaitedCNContactStore.requestAccess(for: .contacts)whenever Contacts auth was undecided. In CLI/headless contexts that callback can fail to resolve promptly, so read commands that only need optional contact-name enrichment can appear to hang even after Messages DB work finished.Fix
ContactsAccessPolicywith the existing default behavior preserved asrequestIfNeeded.skipIfNotDeterminedonly forchatsandhistory, so those read commands fail open without contact-name enrichment.send, RPC, bridge intro, and other explicit contact/name-resolution paths on the default requesting resolver.0.11.1changelog entry thanking @cemendes.Closes #135.
Verification
swift test --filter ContactResolverpassed: 4 tests.swift test --filter 'ChatHistory|ContactResolver|sendCommandResolvesUniqueContactName|sendCommandRejectsAmbiguousContactName|accountNickname'passed: 26 tests, including send/name-resolution coverage.make buildpassed and producedbin/imsgplusbin/imsg-bridge-helper.dylib; only existing helper deprecation warnings were emitted..notDetermined(CNContactStore.authorizationStatus(for: .contacts).rawValue == 0)..notDetermined:bin/imsg chats --limit 1 --jsonreturned within a 10s alarm; sanitized output showed one chat and nocontact_namefield..notDetermined:bin/imsg history --chat-id <id> --limit 1 --jsonreturned within a 10s alarm; sanitized output showed one message and nosender_namefield.make lintexited 0; repo has existing warning-level file length/line length violations, no serious findings.make testpassed: 323 tests.Maintainer note
Local autoreview was attempted but the review engine returned empty output after a long-running child process was stopped, so it is not counted as proof here. The patch was manually reviewed against all
ContactResolver.createcall sites: onlychatsandhistoryopt into no-prompt behavior; send/RPC/name paths still use the default requesting behavior.