Bump Madrid to 0.5.0 and adopt FetchRequest<Message> - #201
Merged
Merged
Conversation
Madrid 0.4.0 deprecated fetchMessages(with:in:limit:), and the project treats warnings as errors, so any bump past 0.1.0 failed the build at the call in Messages.swift. Move that call to fetch(_:) with an equivalent predicate, and pin 0.5.0, which reads the write-ahead log and exposes Message.chatID for the follow-up Messages PRs.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The dependency bump is consistent (tag/revision match) and the Messages.swift migration preserves the documented filtering semantics using Madrid’s supported v0.5.0 API.
Pull request overview
This PR upgrades the iMessage database dependency (Madrid) to v0.5.0 and updates the single call site in MessageService to use Madrid’s newer typed FetchRequest<Message> API, preserving the prior filtering behavior while unblocking builds that treat deprecations as errors.
Changes:
- Bump
loopwork-ai/madriddependency from 0.1.0 to 0.5.0 (and update the pinned revision). - Replace deprecated
fetchMessages(with:in:limit:)usage withFetchRequest<Message>+db.fetch(_:)using equivalent predicates. - Keep prior “no participant filter when no handles matched” behavior while also applying date-range filtering when provided.
File summaries
| File | Description |
|---|---|
| iMCP.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved | Updates the pinned Madrid version/revision to 0.5.0. |
| iMCP.xcodeproj/project.pbxproj | Raises the SwiftPM package minimum version for Madrid to 0.5.0. |
| App/Services/Messages.swift | Migrates message fetching to Madrid’s typed FetchRequest<Message> predicate API. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
toonvl
added a commit
to toonvl/iMCP
that referenced
this pull request
Sep 2, 2026
Brings in the six upstream commits behind #2: the SIGTRAP continuation fix (mattt#151), the Bonjour browser cleanup (mattt#199), the approval setup-timeout exemption (mattt#200), the events_fetch date-only fix (mattt#175), Madrid 0.5.0 with FetchRequest<Message> (mattt#201), and message read status (mattt#195). Three files conflicted, all because upstream shipped its own version of a fix this fork already carried: - CLI/main.swift: took upstream. Its mattt#199 supersedes our inline browser.cancel() (our closed upstream PR mattt#196) by extracting BonjourDiscovery.discoverEndpoint, which cancels on every exit path and comes with tests. - App/Extensions/Foundation+Extensions.swift: took upstream. Its `count > 10` guard on the timezone-suffix regex is equivalent to our `!isDateOnlyISO8601String(...)`; staying identical to upstream is worth more than the marginal precision. - App/Services/Calendar.swift: kept ours. Upstream only annotates `identifier` on the events_fetch and events_create returns, which our private encode(_:) helper already does alongside organizedByMe, organizer, isRecurring and coordinates. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Bumps Madrid from 0.1.0 to 0.5.0.
Madrid 0.4.0 deprecated
fetchMessages(with:in:limit:), and this project treats warnings as errors, so any bump past 0.1.0 failed the build at the one call inMessages.swift(which is why #195 doesn't build as-is). That call now usesfetch(_:)with an equivalent predicate: participant handles when any matched, and the date range when given.0.5.0 also reads the Messages write-ahead log by default (so recent messages aren't hours stale) and exposes
Message.chatID, which #197 and #198 build on.