Conversation
|
Claude finished @insipx's task —— View job Code Review CompleteReview Date: April 3, 2026, 15:22 UTC This PR enables migration client functionality across mobile, node, and wasm bindings by introducing migration-aware environment variants and changing default behavior for Critical IssuesNone remaining - the critical syntax error and build/build_optional_d14n issues were already fixed in commits 4601db9 and 5ea7efe. High Priority1. Inconsistent WASM behavior doesn't match PR description
2. Missing test coverage for migration behavior No tests verify that:
Recommendation: Add integration tests in // Pseudo-code
assert!(matches!(
connect_with_migration_env().bundle,
ClientBundle::Migration { .. }
));
assert!(matches!(
connect_to_backend_exclusive().bundle,
ClientBundle::D14n(_) | ClientBundle::V3(_)
));Medium Priority3. Cache key implementation looks correct Contrary to Macroscope's concern, the cache key implementation in 4. Migration environment naming could be clearer The Low Priority5. Limited documentation of behavioral change The PR introduces a breaking behavioral change where
6. Node/WASM BackendBuilder pattern is good The new SummaryThe implementation is mostly sound with proper cache key separation and a clean builder pattern for node/wasm. Main gaps:
Recommendation: Add tests before merge, update WASM Tasks
|
ApprovabilityVerdict: Needs human review This PR enables new migration client functionality that changes how clients connect to backends - new You can customize Macroscope's approvability policy. Learn more. |
bindings/mobile/src/mls.rs
Outdated
| // switch v3/d14n based on presence of gateway host to preserve | ||
| // previous behavior and avoid breaking changes | ||
| let client_bundle = client_bundle.build_optional_d14n()?; | ||
| let client_bundle = client_bundle.build()?; |
There was a problem hiding this comment.
🟡 Medium src/mls.rs:166
build() returns an error when gateway_host is None, but the surrounding comment explicitly states the intent is to "switch v3/d14n based on presence of gateway host to preserve previous behavior and avoid breaking changes." Since gateway_host is Option<String>, callers passing None (the previous default behavior) will now receive an error instead of a V3 client. This contradicts the documented intent. Consider reverting to build_optional_d14n() or updating the comment to reflect the new requirement.
// switch v3/d14n based on presence of gateway host to preserve
// previous behavior and avoid breaking changes
- let client_bundle = client_bundle.build()?;
+ let client_bundle = client_bundle.build_optional_d14n()?;🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file bindings/mobile/src/mls.rs around lines 166-168:
`build()` returns an error when `gateway_host` is `None`, but the surrounding comment explicitly states the intent is to "switch v3/d14n based on presence of gateway host to preserve previous behavior and avoid breaking changes." Since `gateway_host` is `Option<String>`, callers passing `None` (the previous default behavior) will now receive an error instead of a V3 client. This contradicts the documented intent. Consider reverting to `build_optional_d14n()` or updating the comment to reflect the new requirement.
Evidence trail:
bindings/mobile/src/mls.rs:139-141 (function signature with `gateway_host: Option<String>`), bindings/mobile/src/mls.rs:167-169 (comment and `build()` call), crates/xmtp_api_d14n/src/queries/client_bundle.rs:247-250 (`build()` method calling `inner_build_d14n()`), crates/xmtp_api_d14n/src/queries/client_bundle.rs:170-176 (`inner_build_d14n()` erroring on missing gateway_host), crates/xmtp_api_d14n/src/queries/client_bundle.rs:255-265 (`build_optional_d14n()` method that implements the behavior the comment describes)
5d679cb to
4601db9
Compare
Enable migration client path across mobile, Node, and WASM bindings
connect_to_backend_exclusive(mobile),connectToApiBackendExclusive(iOS/Android), andis_migration()env variants (Node/WASM) to preserve the pre-migration exclusive connection path while making the default connection migration-capable.connect_to_backendon mobile and theBackendBuilder.buildon Node/WASM now callbuilder.build()(migration-capable) instead ofbuilder.build_optional_d14n()when in a migration environment.MigrationLocal,MigrationStaging, andMigrationProductionenv variants are added to Node and WASM bindings to signal migration mode.connect_to_backendnow auto-migrates on D14n cutover; callers that need strict exclusive behavior must switch toconnect_to_backend_exclusive.Macroscope summarized c338984.