Repository navigation
Add ability for mobile to send and receive queries from native host - #9807
EimantasMorkunas wants to merge 5 commits into
Conversation
Follow-Up: Where to Run the Mobile Bridge Tests in CIRecommendation: use display-test-app (DTA) as the shared native integration-test host, with a dedicated bridge-test mode rather than extending the model-download/render sequence. This reuses the existing Android Emulator and iOS Simulator jobs without making messaging tests depend on authentication, downloads, or rendering. Keep pure handler-forwarding tests in core-mobile with ordinary Node/Mocha execution. The locations below were inspected in the local checkouts during the CI follow-up; unlike the original review comments, they are not all pinned to the PR heads. Concrete Insertion Points
Dedicated Bridge-Test Mode
Running without a WebView establishes independence from frontend execution. It does not establish actual OS background behavior; retain a separate app-backgrounding scenario under the app-integration assumptions above. All test initiation, coordination, and completion reporting for that scenario must remain native/backend-driven rather than depending on frontend JavaScript. Why Not Add These Directly to Backend Unit Tests?The existing iOS harness is reusable infrastructure, but not a drop-in home for tests that start
A shared mobile test runner would be cleaner longer term, but it requires more infrastructure. A dedicated DTA mode is the smallest shared integration-test solution for these PRs. Avoid putting mobile bridge tests into core-backend just to reach its iOS runner; the test ownership belongs with core-mobile and the native host integration. CI Enablement GateAt the reviewed native PR revision, build_itwinjs-core.yml does not pass The native macOS job must therefore enable that parameter before these tests will run through this template path. This finding was checked against native PR head This follow-up is a source/YAML investigation only. No runner, app, pipeline, or test implementation was changed, and no simulator/emulator execution was performed. |
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Add APIs for passing queries between backend JS and host:
sendQueryToNative()toMobileDevicethat allows sending queries from JS backend.handleNativeQuery()toMobileDevicethat gets invoked when the host sends a query. Handling can be overridden by settingMobileHost.nativeQueryHandler. It throws by default which responds to all queries with an error.imodel-native-internal: https://github.com/iTwin/imodel-native-internal/pull/1180