Skip to content

messages_fetch: report the conversation each message belongs to - #245

Merged
mattt merged 1 commit into
mainfrom
mattt/messages-conversation
Sep 25, 2026
Merged

mattt merged 1 commit into
mainfrom
mattt/messages-conversation

Conversation

@mattt

@mattt mattt commented Sep 25, 2026

Copy link
Copy Markdown
Owner

This PR brings @patp's #197 onto the current main. #197 conflicted with the attachments change from #244, which touched the same loop in messages_fetch. This is its commit cherry-picked onto main, with @patp as the author, and the conflict resolved to keep both the attachments and the new isPartOf conversation.

Messages the user sends from another device are synced to chat.db
without a sender handle, so until now most of the user's own messages
came back with sender "me" and nothing to tie them to a conversation;
a client could not thread them or tell who they were sent to.

Each message now carries an "isPartOf" Conversation with the chat
identifier, its display name (group chats) and its participants.
Chats are looked up once per call and shared by their messages.

Relies on Message.chatID and ChatPredicate.id from Madrid 0.5.0
(mattt/Madrid#18), which the project already depends on.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No unresolved review issues were identified.

Review effort: Lite
Findings: None

What changed in this PR

Adds conversation metadata to fetched messages while preserving attachment handling.

Changes:

  • Documents isPartOf in messages_fetch.
  • Caches conversation lookups per fetch.
  • Adds conversation IDs, names, and participants.
File Description
App/​Services/​Messages.swift Adds cached conversation metadata to fetched messages.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@mattt
mattt merged commit 10c9d48 into main Sep 25, 2026
2 checks passed
@mattt
mattt deleted the mattt/messages-conversation branch September 25, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants