fix(mobile): connecting an environment no longer crashes the header#22521

merged1
main
duo/navigation
opened3d agobyJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 2d ago

Connecting a new environment can crash development builds with “Couldn't find a navigation context” when the header checkmark becomes a loading indicator. The toolbar options comparison follows the React element's development-only owner into React Navigation's context.

Compare React elements by type, key, and props, and preserve React component/context objects by identity. This keeps equivalent toolbar updates stable without traversing React internals. It also covers custom content in sheet headers.

Verification: 14 focused toolbar and pairing tests pass. The new regression test exercises a custom toolbar element beneath a context with a throwing default, including equivalent renders and changed content. On the iPhone Duo simulator, auto-connect reaches normal connection-error handling without the navigation render error. No visual styling changes.

Implemented by Claude Opus 5.5 through the T3 Code Claude harness; reviewed and verified by GPT-6.1 through the Codex harness.

Checks

All checks passed

Added 1 commit

  • fix(mobile): adding an environment no longer crashes while connectingaaa7380
Synced from GitHub

Approvability

Verdict: Approved at aaa7380

Macroscope's review found this PR approvable — This is a focused mobile crash fix that safely bounds React-element and context handling in the existing header-options signature logic. Regression coverage verifies custom header rendering, deduplication, and updates without changing APIs, product defaults, or deployment behavior.

You can add or adjust custom eligibility rules. Learn more.