Skip to content

Bump Madrid to 0.5.0 and adopt FetchRequest<Message> - #201

Merged
mattt merged 1 commit into
mainfrom
bump-madrid-0.5.0
Sep 2, 2026
Merged

mattt merged 1 commit into
mainfrom
bump-madrid-0.5.0

Conversation

@mattt

@mattt mattt commented Sep 2, 2026

Copy link
Copy Markdown
Owner

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 in Messages.swift (which is why #195 doesn't build as-is). That call now uses fetch(_:) 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.

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.

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.

🟢 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/madrid dependency from 0.1.0 to 0.5.0 (and update the pinned revision).
  • Replace deprecated fetchMessages(with:in:limit:) usage with FetchRequest<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.

@mattt
mattt merged commit 077ff38 into main Sep 2, 2026
2 checks passed
@mattt
mattt deleted the bump-madrid-0.5.0 branch September 2, 2026 19:26
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>
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