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
|
Summary
Avoid hanging
imsg chats/imsg historywhen Contacts authorization is still.notDeterminedin CLI usage.Root cause
ContactResolver.create()currently awaitsCNContactStore.requestAccess(for: .contacts)in the.notDeterminedcase.In some CLI/headless contexts on macOS, that callback does not resolve promptly, which means commands that eagerly create a
ContactResolvercan appear to hang indefinitely even though the underlying Messages DB work already completed.Fix
Fail open when Contacts auth is
.notDetermined:This keeps core read paths working and only skips optional contact-name enrichment.
Why this is safe
chatsandhistorystill return useful output without contact names.authorized,.denied, and.restrictedis preservedManual verification
Before this change, on macOS 26.4.1 with Contacts auth still undecided:
imsg chats --limit 1 --jsonhangsimsg history --chat-id 1090 --limit 1 --jsonhangsimsg group --chat-id 1090 --jsonreturns immediatelyCNContactStore.requestAccessprobe times out after 5s without callbackAfter this change:
imsg chatsandimsg historyshould return normallyVerification in this branch
swift build✅make testTestingbut the module is unavailable here (no such module 'Testing')make lintswiftlintis not installedFollow-up idea
Longer term, contact resolution should probably be opt-in (for example
--resolve-contacts) rather than an implicit part of core read commands.Closes #135