You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Refactor] Extract a shared helper for dynamic-route path joining (root-base slash normalization) #98145
The logic that joins a dynamic-route base path with its suffix — special-casing a root base (/) so the two aren't concatenated into a //-prefixed (protocol-relative) path — is duplicated in several places in the navigation layer:
Each site independently does base === '/' ? \/${suffix}` : `${base}/${suffix}`. Because this same rule lives in multiple places, it's easy for one copy to drift or be forgotten — which is exactly what caused the SecurityError: Failed to execute 'pushState'crash fixed in Expensify/App#97849 (thegetPathFromStatecopy was missing the root-base guard and produced//ai-features-promo`).
Proposed change
Extract a small shared helper (e.g. joinPathSegments(base, suffix)) that returns the correctly-adjusted path, and use it at every site above so the slash-normalization rule is defined once.
Note
This came out of a NAB review comment on the fix PR: #97849 (comment)
NAB: Maybe we can extract a helper to return an adjusted path. I see that this logic is repeated elsewhere in the code
This issue has not been updated in over 15 days. @mountiny, @collectioneur eroding to Monthly issue.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.76-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
Activity
melvin-bot commentedon Sep 3, 2026
This issue has not been updated in over 15 days. @mountiny, @collectioneur eroding to Monthly issue.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
mountiny commentedon Sep 9, 2026
@collectioneur Are you able to follow up on this one?
collectioneur commentedon Sep 9, 2026
Sure, I'll prepare a PR for this. Missed that!
collectioneur commentedon Sep 9, 2026
Opened the PR
melvin-bot commentedon Sep 11, 2026
@mountiny @collectioneur
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.76-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
melvin-bot commentedon Sep 14, 2026
@collectioneur Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
collectioneur commentedon Sep 15, 2026
Not overdue
mountiny commentedon Sep 17, 2026
This is done