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
[Due for payment 2026-07-16] [$250] Android: SmartScan shortcut re-navigates when already on SmartScan screen #88009
If you open SmartScan via the Android static shortcut, background the app, then long-press and tap "SmartScan" again, the app flickers and re-navigates from SmartScan to SmartScan unnecessarily.
This was observed during QA of Mobile-Expensify#13906 (trampoline activity fix). The same likely applies to the "Manually Create" shortcut.
The fix is expected to be a NewDot navigation-layer change — the app should detect it's already on the target screen and skip the redundant navigation.
Issue OwnerCurrent Issue Owner: @mallenexpensifyUpwork Automation - Do Not Edit
changed the title [-]Android: SmartScan shortcut re-navigates when already on SmartScan screen[/-][+][$250] Android: SmartScan shortcut re-navigates when already on SmartScan screen[/+]on May 4, 2026
Please re-state the problem that we are trying to solve in this issue.
Opening SmartScan via the Android static shortcut, backgrounding the app, then long-pressing the app icon and tapping "SmartScan" again causes NewDot to re-navigate from SmartScan to SmartScan. The user sees a visible flicker and the screen remounts even though the target tab is already visible. The same behavior is expected to apply to the "Manually Create" static shortcut. The fix is expected to live in the NewDot navigation layer: detect that the app is already on the target tab and drop the redundant navigation before it reaches React Navigation.
What is the root cause of that problem?
When an Android static shortcut is tapped, the host activity forwards the intent to NewDot as a deep link URL via Linking. The URL is received inside the React Navigation linking config's subscribe listener, which is where incoming URLs get a chance to be intercepted before the navigation tree reacts to them.
That listener already contains a dedup guard, but only for the GPS distance screen:
The guard returns early when the URL targets distance-gps AND the currently focused route name is distance-gps, which is exactly the "already on the target tab" check needed here. This guard was added to kill the flicker from tapping the GPS live update notification while the GPS tab is already visible.
For every other route — including the targets of the SmartScan and Manually Create Android shortcuts — the listener forwards the URL unchanged. React Navigation then resolves the URL against the linking config, sees a route path whose final segment is scan or manual, and fires a navigation action into the IOURequestStartPage tab navigator. Because that tab is already focused, React Navigation still processes the action (there is no built-in "already active, skip" dedup at this level), which remounts the tab subtree — producing the observed flicker.
The IOURequestStartPage top tab navigator names its tabs after the CONST.TAB_REQUEST values ('scan', 'manual', 'distance-gps', etc.), which is why the existing GPS check can compare findFocusedRoute(state)?.name directly against ROUTES.DISTANCE_REQUEST_CREATE_TAB_GPS.route (which evaluates to 'distance-gps'). The same identity holds for ROUTES.MONEY_REQUEST_CREATE_TAB_SCAN.route ('scan') and ROUTES.MONEY_REQUEST_CREATE_TAB_MANUAL.route ('manual'):
So the reason the bug exists is narrow: the subscribe listener's dedup check was scoped to a single route constant at the time of its addition, and the Android static shortcut targets were never added to it. Any route not named in that check has no protection against a deep-link-driven re-navigation to the already-focused tab.
What changes do you think we should make in order to solve the problem?
Generalize the dedup guard in src/libs/Navigation/linkingConfig/subscribe.ts so that it also covers the Android static shortcut targets. Concretely:
Introduce a small list of tab route names that must not be re-navigated when already active. The list starts with the existing GPS entry and adds the two routes the reported bug hits: ROUTES.DISTANCE_REQUEST_CREATE_TAB_GPS.route, ROUTES.MONEY_REQUEST_CREATE_TAB_SCAN.route, and ROUTES.MONEY_REQUEST_CREATE_TAB_MANUAL.route.
For an incoming URL, determine which (if any) entry in this list the URL is targeting. Use a boundary-aware match — check whether the URL's path ends with /<route> or /<route>?... rather than a loose substring include — so that tokens like scan and manual cannot be matched inside unrelated URLs.
If the incoming URL targets an entry in the list AND findFocusedRoute(navigationRef.current?.getRootState())?.name equals that same entry, return early without calling listener(url). Otherwise, forward the URL as before.
This keeps the existing GPS behavior identical (the GPS route is still in the list, the focused-route comparison is still the same), and extends the same protection to the two shortcut-driven tabs named in the issue. The change is scoped to one file and one function, requires no SCREENS constants, and uses existing ROUTES and CONST.TAB_REQUEST values whose equality to tab navigator route names is already load-bearing for the current GPS guard.
Because the dedup happens at the Linking subscription layer — before React Navigation sees the URL — the flicker is prevented at its source, whether the URL originates from an Android static shortcut, a live-update notification, or a share-sheet intent. No native Android changes are required; the trampoline activity fix in Mobile-Expensify#13906 already narrows the path down to the deep link URL that this guard intercepts.
Expected behavior after the change:
Tapping the "SmartScan" static shortcut while the SmartScan tab is already focused → the URL is dropped, no navigation occurs, no flicker.
Tapping the "Manually Create" static shortcut while the Manual tab is already focused → same, no flicker.
Tapping either shortcut while on any other screen → normal navigation to the target tab, unchanged from today.
What alternative solutions did you explore? (Optional)
The fix could alternatively be placed inside the IOU action layer — specifically before each Navigation.navigate() call inside startMoneyRequest() and startDistanceRequest() in src/libs/actions/IOU/index.ts:
Each case currently calls Navigation.navigate(ROUTES.MONEY_REQUEST_CREATE_TAB_*.getRoute(...)) unconditionally; adding a Navigation.getActiveRouteWithoutParams() comparison before each call would also suppress the redundant navigation.
I did not choose this location for three reasons. First, the issue description explicitly points to "a NewDot navigation-layer change" and the linking subscription layer is the navigation layer for deep-link URLs — the IOU action layer is a different concern. Second, subscribe.ts already contains the prior-art dedup for the GPS case, so generalizing it keeps a single place that owns "don't re-navigate into a tab you're already on" instead of duplicating the same idea at both the linking layer and the IOU action layer. Third, startMoneyRequest() is also called by in-app flows (FAB menu, keyboard shortcuts, QuickActionNavigation.ts) which rely on the accompanying clearMoneyRequest(...) call inside the function to reset draft state; skipping the navigate there would still leave the draft cleared, which could surprise callers that depend on the re-mount to rebuild transient UI state. Fixing at the linking subscription layer affects only deep-link-driven navigations and leaves in-app paths untouched.
Activity
DylanDylann commentedon Apr 16, 2026
I think we should track this problem in the original issue
Julesssss commentedon Apr 17, 2026
Fine by me, commented here.
melvin-bot commentedon May 4, 2026
Current assignee @DylanDylann is eligible for the External assigner, not assigning anyone new.
[-]Android: SmartScan shortcut re-navigates when already on SmartScan screen[/-][+][$250] Android: SmartScan shortcut re-navigates when already on SmartScan screen[/+]melvin-bot commentedon May 4, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022051339307394222351
wildan-m commentedon May 4, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
Opening SmartScan via the Android static shortcut, backgrounding the app, then long-pressing the app icon and tapping "SmartScan" again causes NewDot to re-navigate from SmartScan to SmartScan. The user sees a visible flicker and the screen remounts even though the target tab is already visible. The same behavior is expected to apply to the "Manually Create" static shortcut. The fix is expected to live in the NewDot navigation layer: detect that the app is already on the target tab and drop the redundant navigation before it reaches React Navigation.
What is the root cause of that problem?
When an Android static shortcut is tapped, the host activity forwards the intent to NewDot as a deep link URL via
Linking. The URL is received inside the React Navigation linking config'ssubscribelistener, which is where incoming URLs get a chance to be intercepted before the navigation tree reacts to them.That listener already contains a dedup guard, but only for the GPS distance screen:
App/src/libs/Navigation/linkingConfig/subscribe.ts
Lines 8 to 25 in 3d9b33b
The guard returns early when the URL targets
distance-gpsAND the currently focused route name isdistance-gps, which is exactly the "already on the target tab" check needed here. This guard was added to kill the flicker from tapping the GPS live update notification while the GPS tab is already visible.For every other route — including the targets of the SmartScan and Manually Create Android shortcuts — the listener forwards the URL unchanged. React Navigation then resolves the URL against the linking config, sees a route path whose final segment is
scanormanual, and fires a navigation action into theIOURequestStartPagetab navigator. Because that tab is already focused, React Navigation still processes the action (there is no built-in "already active, skip" dedup at this level), which remounts the tab subtree — producing the observed flicker.The
IOURequestStartPagetop tab navigator names its tabs after theCONST.TAB_REQUESTvalues ('scan','manual','distance-gps', etc.), which is why the existing GPS check can comparefindFocusedRoute(state)?.namedirectly againstROUTES.DISTANCE_REQUEST_CREATE_TAB_GPS.route(which evaluates to'distance-gps'). The same identity holds forROUTES.MONEY_REQUEST_CREATE_TAB_SCAN.route('scan') andROUTES.MONEY_REQUEST_CREATE_TAB_MANUAL.route('manual'):App/src/ROUTES.ts
Lines 1595 to 1603 in 3d9b33b
App/src/CONST/index.ts
Lines 6264 to 6274 in 3d9b33b
So the reason the bug exists is narrow: the
subscribelistener's dedup check was scoped to a single route constant at the time of its addition, and the Android static shortcut targets were never added to it. Any route not named in that check has no protection against a deep-link-driven re-navigation to the already-focused tab.What changes do you think we should make in order to solve the problem?
Generalize the dedup guard in
src/libs/Navigation/linkingConfig/subscribe.tsso that it also covers the Android static shortcut targets. Concretely:ROUTES.DISTANCE_REQUEST_CREATE_TAB_GPS.route,ROUTES.MONEY_REQUEST_CREATE_TAB_SCAN.route, andROUTES.MONEY_REQUEST_CREATE_TAB_MANUAL.route./<route>or/<route>?...rather than a loose substring include — so that tokens likescanandmanualcannot be matched inside unrelated URLs.findFocusedRoute(navigationRef.current?.getRootState())?.nameequals that same entry, return early without callinglistener(url). Otherwise, forward the URL as before.This keeps the existing GPS behavior identical (the GPS route is still in the list, the focused-route comparison is still the same), and extends the same protection to the two shortcut-driven tabs named in the issue. The change is scoped to one file and one function, requires no SCREENS constants, and uses existing
ROUTESandCONST.TAB_REQUESTvalues whose equality to tab navigator route names is already load-bearing for the current GPS guard.Because the dedup happens at the
Linkingsubscription layer — before React Navigation sees the URL — the flicker is prevented at its source, whether the URL originates from an Android static shortcut, a live-update notification, or a share-sheet intent. No native Android changes are required; the trampoline activity fix in Mobile-Expensify#13906 already narrows the path down to the deep link URL that this guard intercepts.Expected behavior after the change:
What alternative solutions did you explore? (Optional)
The fix could alternatively be placed inside the IOU action layer — specifically before each
Navigation.navigate()call insidestartMoneyRequest()andstartDistanceRequest()insrc/libs/actions/IOU/index.ts:App/src/libs/actions/IOU/index.ts
Lines 981 to 996 in 3d9b33b
Each case currently calls
Navigation.navigate(ROUTES.MONEY_REQUEST_CREATE_TAB_*.getRoute(...))unconditionally; adding aNavigation.getActiveRouteWithoutParams()comparison before each call would also suppress the redundant navigation.I did not choose this location for three reasons. First, the issue description explicitly points to "a NewDot navigation-layer change" and the linking subscription layer is the navigation layer for deep-link URLs — the IOU action layer is a different concern. Second,
subscribe.tsalready contains the prior-art dedup for the GPS case, so generalizing it keeps a single place that owns "don't re-navigate into a tab you're already on" instead of duplicating the same idea at both the linking layer and the IOU action layer. Third,startMoneyRequest()is also called by in-app flows (FAB menu, keyboard shortcuts,QuickActionNavigation.ts) which rely on the accompanyingclearMoneyRequest(...)call inside the function to reset draft state; skipping the navigate there would still leave the draft cleared, which could surprise callers that depend on the re-mount to rebuild transient UI state. Fixing at the linking subscription layer affects only deep-link-driven navigations and leaves in-app paths untouched.Compare branch: https://github.com/Expensify/App/compare/main...wildan-m:App:wildan/88009-dedup-shortcut-deep-link?expand=1
48 remaining items
melvin-bot commentedon Jul 15, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Jul 15, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
melvin-bot commentedon Jul 16, 2026
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
mallenexpensify commentedon Jul 17, 2026
^ Test case created. Thx
Closing
gijoe0295 commentedon Jul 18, 2026
@mallenexpensify I think I'm due payment here because I implemented the PR cc @Julesssss
mallenexpensify commentedon Jul 20, 2026
Payment Summary
Contributor+: @gijoe0295 due $250 via NewDot
oops, missed that. Sorry @gijoe0295
JmillsExpensify commentedon Jul 22, 2026
$250 approved for @gijoe0295