Skip to content

Update to libxmtp 4.10.0-dev.85f2090#667

Open
xmtptools wants to merge 1 commit into
cv/dev-release-4.9.0-retain-cycle-fix-reduce-db-connectionfrom
update-to-swift-bindings-1.10.0-dev.85f2090
Open

Update to libxmtp 4.10.0-dev.85f2090#667
xmtptools wants to merge 1 commit into
cv/dev-release-4.9.0-retain-cycle-fix-reduce-db-connectionfrom
update-to-swift-bindings-1.10.0-dev.85f2090

Conversation

@xmtptools

Copy link
Copy Markdown
Collaborator

This PR updates the iOS bindings to libxmtp version 4.10.0-dev.85f2090.

Changes:

  • Updated XMTP.podspec version to 4.10.0-dev.85f2090
  • Updated binary (LibXMTPSwiftFFI) URL and checksum in Package.swift
  • Updated Swift source file (xmtpv3.swift)

Base branch: cv/dev-release-4.9.0-retain-cycle-fix-reduce-db-connection

@xmtptools xmtptools requested a review from a team as a code owner January 31, 2026 00:20
@claude

claude Bot commented Jan 31, 2026

Copy link
Copy Markdown

Claude finished @xmtptools's task —— View job


PR Review Complete ✅

I've analyzed the libxmtp update to version 4.10.0-dev.85f2090. Here's my comprehensive feedback:

📋 Summary

This PR updates the iOS bindings to libxmtp 4.10.0-dev.85f2090. The changes are primarily in auto-generated FFI bindings from the Rust layer, with some breaking API changes that require attention.


What's Good

  • Version Consistency: All three files (Package.swift, XMTP.podspec, xmtpv3.swift) are consistently updated to the same version
  • Code Generation: The xmtpv3.swift file appears to be properly auto-generated with correct UniFFI bindings
  • Binary Checksum: Package.swift includes proper checksum for the binary framework

⚠️ CRITICAL ISSUE: Breaking API Changes Not Reflected in Higher-Level Wrappers

The FFI layer has renamed several critical methods, but the higher-level Swift wrapper code in Group.swift and Conversations.swift is still calling the old method names. This will cause compilation failures.

Breaking Changes in FFI:

  1. Group member management (Group.swift:177, 183, 189, 198):

    • addMembersByInboxId() → ✅ addMembers() (now takes inboxIds)
    • removeMembersByInboxId() → ✅ removeMembers() (now takes inboxIds)
    • addMembers() → ✅ addMembersByIdentity() (now takes accountIdentifiers)
    • removeMembers() → ✅ removeMembersByIdentity() (now takes accountIdentifiers)
  2. Group creation (Conversations.swift:592, 667):

    • createGroup(accountIdentities:) → ✅ createGroupByIdentity(accountIdentities:)
    • createGroupWithInboxIds() → ✅ createGroup() (now takes inboxIds as default)
  3. DM creation (Conversations.swift:487, 523):

    • findOrCreateDm(targetIdentity:) → ✅ findOrCreateDmByIdentity(targetIdentity:)
    • findOrCreateDmByInboxId() → ✅ findOrCreateDm() (now takes inboxId as default)

Required Fixes:

In Sources/XMTPiOS/Group.swift:

  • Line 177: ffiGroup.addMembersByInboxIdffiGroup.addMembers
  • Line 183: ffiGroup.removeMembersByInboxIdffiGroup.removeMembers
  • Line 189-191: ffiGroup.addMembersffiGroup.addMembersByIdentity
  • Line 198-200: ffiGroup.removeMembersffiGroup.removeMembersByIdentity

In Sources/XMTPiOS/Conversations.swift:

  • Line 487-494: findOrCreateDmfindOrCreateDmByIdentity
  • Line 523-530: findOrCreateDmByInboxIdfindOrCreateDm
  • Line 592-605: createGroup(accountIdentities:)createGroupByIdentity(accountIdentities:)
  • Line 667-680: createGroupWithInboxIdscreateGroup

📊 Removed Features

The following FFI methods have been removed entirely from FfiXmtpClient:

  • archiveMetadata() - Load metadata from archive files
  • createArchive() - Export archives for backup
  • importArchive() - Import from archive backups
  • sendSyncRequest() - Manual device sync triggering

Impact: If any higher-level code uses these features, those features will break. I did not find references to these in the current codebase.


🆕 New Features Added

Two new methods were added to FfiXmtpClient:

  • fetchInboxUpdatesCount(refreshFromNetwork:inboxIds:) - Get update counts for specific inboxes
  • fetchOwnInboxUpdatesCount(refreshFromNetwork:) - Get own inbox update count

New struct: FfiAvailableArchive - Appears to be part of a refactored archive system


🔒 Security Considerations

  • No obvious security issues introduced
  • Binary checksum validation ensures integrity of the LibXMTPSwiftFFI framework
  • No credentials or sensitive data exposed

🧪 Test Coverage

  • ⚠️ No tests were updated in this PR
  • Given the breaking API changes, tests that exercise group/DM creation and member management will likely fail
  • Recommendation: Run the full test suite (./script/run_tests.sh) after fixing the wrapper code to identify any affected tests

🎯 Performance Considerations

  • The FFI changes appear to simplify the API surface (InboxId-based methods are now the default)
  • Reduction in code size: -296 +212 lines in xmtpv3.swift suggests cleaner generated code
  • No obvious performance regressions expected

Action Items

Before merging, you MUST:

  1. ✅ Update Group.swift to use new FFI method names (4 changes)
  2. ✅ Update Conversations.swift to use new FFI method names (4 changes)
  3. ✅ Run swift build to verify compilation succeeds
  4. ✅ Run ./script/run_tests.sh to ensure all tests pass
  5. ✅ Run ./dev/lint if SwiftLint is available
  6. ⚠️ Consider documenting the archive/sync method removals if they were public API

📝 Code Quality

  • Auto-generated code follows consistent patterns
  • Proper error handling with async/await
  • Type-safe Swift bindings

Overall Assessment: This is a standard libxmtp bindings update, but it introduces breaking changes that require corresponding updates to the Swift wrapper layer. The PR cannot be merged as-is without compilation failures.


@macroscopeapp

macroscopeapp Bot commented Jan 31, 2026

Copy link
Copy Markdown

Update XMTP iOS bindings to libxmtp 4.10.0-dev.85f2090 and switch member/group/DM APIs to inbox ID parameters across FfiConversation, FfiConversations, and add inbox update count methods in FfiXmtpClient

Bumps the binary target and podspec version, replaces identity-based parameters with inbox ID variants for member management and DM/group creation, removes archive/sync APIs, and adds inbox update count retrieval in client bindings.

📍Where to Start

Start with protocol and method changes in xmtpv3.swift, focusing on FfiConversation, FfiConversations, and FfiXmtpClient method signatures and FFI calls.


Macroscope summarized 3b6c80a.

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