Skip to content

Add chatId to messages_fetch - #1

Closed
sebpretzer wants to merge 1 commit into
mainfrom
messages-fetch-chat-id
Closed

sebpretzer wants to merge 1 commit into
mainfrom
messages-fetch-chat-id

Conversation

@sebpretzer

Copy link
Copy Markdown
Owner

No description provided.

@sebpretzer sebpretzer left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

do we need to add tests?

Comment thread App/Services/Messages.swift Outdated

Copilot AI left a comment

Copy link
Copy Markdown

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

The new parameter is correctly validated and applied using the existing typed chat predicate.

Review effort: Balanced
Findings: None

What changed in this PR

Adds conversation-specific filtering to messages_fetch.

Changes:

  • Documents and accepts a chatId argument.
  • Applies the corresponding MessagePredicate.chatID filter.
File Description
App/​Services/​Messages.swift Adds parsing, schema documentation, and filtering for chatId.

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

@sebpretzer

sebpretzer commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner Author

Re: tests — not adding any, for these reasons:

Verified against a real chat.db instead (a local Debug build, 300-message limit, one three-person group chat):

Call From the target chat Chats returned
participants = the three members, no chatId 141 / 300 15
chatId 300 / 300 1
chatId + participants = one member 300 / 300 (only that member and me) 1
unknown chatId 0 messages —
chatId: 123 error: "chatId has the wrong type" —

isPartOf reports each message's conversation @id, but nothing accepted
it back. chatId maps to Madrid's chatID predicate and composes with the
other filters, so chatId plus participants returns those senders' messages
in that conversation. An unknown chatId matches nothing rather than
falling back to every chat.
@sebpretzer
sebpretzer force-pushed the messages-fetch-chat-id branch from cc7d40a to 94ae8ba Compare September 27, 2026 19:40
@sebpretzer

Copy link
Copy Markdown
Owner Author

Moved to mattt#251

@sebpretzer sebpretzer closed this Sep 27, 2026
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.

2 participants