Remove unsafe assertions from navigation and debug helpers - #100768
Draft
KJ21-ENG wants to merge 1 commit into
Draft
Remove unsafe assertions from navigation and debug helpers#100768KJ21-ENG wants to merge 1 commit into
KJ21-ENG wants to merge 1 commit into
Conversation
Seatbelt-Operation: s08-43192ddd-4541881-sign-1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
Replace unsafe assertions in navigation and developer debugging helpers with producer-derived types, category-preserving state reconstruction and local field checks. The parser accepts the strings its callers already produce; debug reads retain legacy-message priority and intentionally add synchronous-callback support and duplicate-callback suppression.
Changed files:
src/libs/Navigation/helpers/getAdaptedStateFromPath.tssrc/libs/Navigation/helpers/getPathFromState.tssrc/libs/Navigation/helpers/getStateFromPath.tssrc/libs/Navigation/helpers/linkTo/getMinimalAction.tssrc/libs/Navigation/helpers/linkTo/index.tssrc/setup/addUtilsToWindow.tsFixed Issues
$ #94739
PROPOSAL: #94739 (comment)
Tests
Passed: 146 tests in 13 existing Jest suites, 34 runtime/falsifier groups, focused lint, formatting and spelling. Fork checks passed typecheck, lint, format, React Compiler and Jest. Local TypeScript was waived: zero changed-file diagnostics, but 43 imported-file diagnostics prevented complete coverage. Focused lint retains four existing support-file warnings.
Probes cover dispatch ordering, full/partial state metadata, strict report IDs, legacy lookups and callback timing. URL encoding and decoding retain delimiter collision handling and query precedence. Extracted probes do not establish Babel integration, browser history or native gestures; Jest coverage is bounded. No committed tests were added.
Local manual testing remains pending: follow QA steps below; on a nonproduction browser report screen, await window.report, window.transaction, window.policy and window.receipt. Verify matching available records and undefined for missing records; use Onyx.get/log with that report's stored key and verify the returned/logged value.
Offline tests
Pending: load a report and attachment online, disconnect, repeat cached navigation and back actions. Expect cached content and the same report context; verify again after reconnecting.
QA Steps
Manual QA required. QA before review: shared navigation branches control deep links, tab backgrounds and history. Pending on staging, using desktop/mobile browsers and iOS/Android native:
PR Author Checklist
Manual, offline, failure-flow, high-traffic and all-platform checks remain unperformed. No UI, copy, styles, assets, generic components or Storybook changes require conditional checks.
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Not captured; manual QA is pending.