feat(bindings_mobile): expose the app data change callback and update guard - #4012
Conversation
|
Claude finished @tylerhawkes's task —— View job PR Review Completed
Review Feedback2026-08-19 20:04 UTC The implementation follows established patterns in the codebase (mirroring Test CoverageThe 10% patch coverage (18 missing lines in bindings/mobile/src/mls/change_callbacks.rs:88-90 — The This is a nice-to-have rather than a blocker — the real validation happens in #4015 and #4016. Code quality, API design, security, and performance look good. No bugs identified. |
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Additive FFI bindings exposing existing core functionality to mobile clients. All new parameters have backwards-compatible defaults. The author owns all changed files and the changes are well-scoped with minimal risk. No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## tyler/appdata-cb-core #4012 +/- ##
=========================================================
- Coverage 85.91% 85.88% -0.04%
=========================================================
Files 418 419 +1
Lines 68328 68348 +20
=========================================================
- Hits 58705 58700 -5
- Misses 9623 9648 +25 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
c8c03a8 to
7f9f852
Compare
8583651 to
2a822f7
Compare
Dismissing prior approval to re-evaluate 2a822f7
2a822f7 to
5b80031
Compare
Dismissing prior approval to re-evaluate 5b80031
5b80031 to
f7a9599
Compare
Dismissing prior approval to re-evaluate f7a9599
f7a9599 to
f70bd28
Compare
f70bd28 to
cce6731
Compare
Stack
Merge bottom-up — each PR is based on its parent below.
Android is the priority path: #4019 → #4011 → #4012 → #4016.
IntentState::Superseded(base:main)Already merged: #4018 (proto regen). Related follow-up, independent of this stack: #4020.
Exposes the unstable app-data change callback over uniffi, for iOS and Android.
Shape
FfiUnstableChangeCallbacksis a uniffi Record whose every field carries#[uniffi(default = ...)]— the convention already used byFfiCatchUpOptionsandFfiUpdateAppDataOptions. Adding a callback for another mutable field later is additive: the generated Swift/Kotlin constructors keep their existing shape and compiled apps do not break.Confirmed by the generated Swift, which comes out as:
FfiAppDataChangeCallbackis an async foreign trait (#[uniffi::export(with_foreign)]+#[xmtp_common::async_trait]), bridged to the core trait byFfiAppDataChangeCallbackBridge— the same pattern asFfiAuthCallbackBridge.Registration
A new trailing
change_callbacks: Option<FfiUnstableChangeCallbacks>oncreate_client, alongsidefork_recovery_optsandworker_config. PassingNoneregisters nothing and costs oneOptioncheck per processed message.This does add a parameter to the exported
create_clientsignature, so every Swift and Kotlin caller must pass a value. The SDK wrappers in the follow-up PRs default it tonil, so app authors see no change.Note on the test call sites
The 22 updated
create_clientcalls in tests and benches are all mechanicalNoneadditions.🤖 Generated with Claude Code
https://claude.ai/code/session_01AdY7WKkNbJmdzpmUWvW1my
Note
Expose app data change callbacks and compare-and-swap guard in mobile FFI bindings
change_callbacksparameter tocreate_clientin mls.rs, allowing callers to register an asyncFfiAppDataChangeCallbackthat fires when group app data changes.FfiAppDataChange,FfiAppDataChangeCallback,FfiUnstableChangeCallbacks, and a bridge adapter that converts core events to foreign FFI callbacks.expected_valuefield toFfiUpdateAppDataOptions, wiring it through to the innerupdate_app_datacall as a compare-and-swap guard; mismatches may now return an error instead of overwriting.Nonefor the new parameters, keeping current behavior unchanged.Macroscope summarized cce6731.