messages_fetch: report the conversation each message belongs to - #245
Merged
Merged
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.
Contributor
There was a problem hiding this comment.
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
isPartOfinmessages_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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR brings @patp's #197 onto the current
main. #197 conflicted with the attachments change from #244, which touched the same loop inmessages_fetch. This is its commit cherry-picked ontomain, with @patp as the author, and the conflict resolved to keep both the attachments and the newisPartOfconversation.