-
Notifications
You must be signed in to change notification settings - Fork 94
Description
Bug
imsg typing --chat-id <id> fails with:
typingIndicatorFailed("Chat not found for identifier: any;-;+14155551212. Make sure Messages.app has an active conversation with this contact.")
Root cause
The chat table in chat.db stores GUIDs with an any;-; prefix for some conversations:
SELECT ROWID, chat_identifier, guid, service_name FROM chat WHERE ROWID = 1;
-- 1|+14155551212|any;-;+14155551212|iMessage|When --chat-id is used, ChatTargetResolver.resolveChatTarget resolves to a ResolvedChatTarget with GUID any;-;+14155551212. Then preferredIdentifier returns the GUID (preferred over identifier). This gets passed to TypingIndicator.lookupChat, which tries both existingChatWithGUID: and existingChatWithChatIdentifier: on IMCore's IMChatRegistry — but IMCore doesn't recognize the any;-; prefix. It expects iMessage;-; or SMS;-;.
Suggested fix
When the GUID has an any;-; prefix, rewrite it using the chat's service_name from the DB. For example:
any;-;+14155551212+ serviceiMessage→iMessage;-;+14155551212any;-;+14155551212+ serviceSMS→SMS;-;+14155551212
Alternatively, TypingIndicator.lookupChat could try stripping any;-; and re-querying with iMessage;-; / SMS;-; as a fallback.
Workaround
Using --chat-identifier "iMessage;-;+14155551212" directly bypasses the GUID path but requires knowing the service type.
Version: 0.5.0 / macOS 15 (Sequoia)