Remove unsafe assertion from dynamic route screen detection - #100677
Draft
KJ21-ENG wants to merge 1 commit into
Draft
Remove unsafe assertion from dynamic route screen detection#100677KJ21-ENG wants to merge 1 commit into
KJ21-ENG wants to merge 1 commit into
Conversation
Seatbelt-Operation: s08-159f3a24-00c6c5f-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
This removes an unnecessary type assertion from dynamic-route screen detection. The configured path is already a
string, and the existingSet<string>accepts it directly, so the optional lookup, empty-path guard, exact membership test, and navigation behavior stay unchanged.The only changed file is
src/libs/Navigation/helpers/dynamicRoutesUtils/isDynamicRouteScreen.ts.Fixed Issues
$ #94739
PROPOSAL: #94739 (comment)
Tests
isDynamicRouteScreenTests.tspassed all 9 cases for configured dynamic paths, regular paths, and an absent configuration. A mutation that inverted theSetresult was detected by the 8 configured and regular-path cases.Limitations: there is no explicit empty-path test. The Jest cases do not distinguish this exact membership check from the broader dynamic-suffix helper, although that helper was not substituted. No manual, device, offline, all-platform, or console QA was performed.
Offline tests
Not applicable. This cleanup changes no requests or offline handling; offline testing was not performed.
QA Steps
On macOS Chrome in staging, sign in and open Settings > Profile > Personal details > Home address > Country. Verify the Country screen opens and the URL ends in
/country; refresh the page, then use Back and verify navigation returns to Home address without an unexpected fullscreen or routing state. Open a regular Settings screen and verify its refresh and Back behavior remain normal. Check the JS console for errors. These steps are recommended and have not been performed.PR Author Checklist
### 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 applicable. This cleanup has no visual effect, and no screenshots or videos were produced.