-
Notifications
You must be signed in to change notification settings - Fork 158
Bug: imsg chats/history can hang when Contacts auth is not determined #135
Copy link
Copy link
Closed
Labels
P2Normal priority bug or improvement with limited blast radius.Normal priority bug or improvement with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopThis issue is about crashes, hangs, restart loops, or process-level availability.This issue is about crashes, hangs, restart loops, or process-level availability.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Metadata
Metadata
Assignees
Labels
P2Normal priority bug or improvement with limited blast radius.Normal priority bug or improvement with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopThis issue is about crashes, hangs, restart loops, or process-level availability.This issue is about crashes, hangs, restart loops, or process-level availability.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Bug:
imsg chats/imsg historycan hang on macOS when Contacts auth is.notDeterminedSummary
On macOS 26.4.1,
imsg chatsandimsg historycan hang indefinitely in CLI usage when Contacts permission has not yet been decided (CNContactStore.authorizationStatus(for: .contacts) == .notDetermined).This appears to be caused by
ContactResolver.create()awaitingrequestAccess(for: .contacts)from a CLI path. In this environment, the callback never resolves promptly, so the command appears to hang.What works
imsg group --chat-id 1090 --jsonreturns immediatelyWhat hangs
imsg chats --limit 1 --jsonimsg chats --limit 1imsg history --chat-id 1090 --limit 1 --jsonEvidence
Direct Swift probe:
swift -e 'import Contacts; print(CNContactStore.authorizationStatus(for: .contacts).rawValue)'returns:
(
.notDetermined)And:
outputs:
So the permission request path itself is the hang.
Likely root cause
ChatsCommand.run()andHistoryCommand.run()eagerly call:And
ContactResolver.create()currently does:That blocks core read commands on a permission flow that may not complete in CLI/headless contexts.
Proposed fix
Fail open for
.notDetermined:This preserves core
chats/historybehavior and only disables optional contact-name enrichment.Better long-term design
Make contact resolution opt-in (for example
--resolve-contacts) instead of automatic for allchats/historycalls.