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-11-09] Travel-no error modal appears when clicking travel on home page #99041
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributorImprovementItem broken or needs improvement.ReviewingHas a PR in review
Version Number: v9.4.57-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack:#98484 Email or phone of affected tester (no customers):applausetester+newpiyoa1@applause.expensifail.com Issue reported by: Applause Internal Team Bug source: Pull Request QA execution Device used: Windows 11 / Chrome App Component: Other
The default-workspace travel guard is only wired into one branch of the Home quick-action Travel handler, so the "not enabled on your default workspace" modal is skipped on the path that opens the Book Travel RHP.
In handleBookTravel, blockIfDefaultWorkspaceLacksTravel() is called only insideif (isTravelReady). When isTravelReady is false, execution falls through to Navigation.navigate(ROUTES.TRAVEL_MY_TRIPS...), which opens the Book Travel RHP without ever calling the guard — so no error modal appears. This is exactly the reported symptom.
A second, contributing flaw: travelEnabledPolicy is Object.values(allPolicies).find((p) => p?.isTravelEnabled) — the first workspace with travel enabled, not the default/active one. So with "Travel WS" enabled, the button shows and books against that workspace even though the default "No Travel WS" has travel disabled. The guard itself is correct — useDefaultWorkspaceTravelGuard checks the active policy (NVP_ACTIVE_POLICY_ID) — it just isn't invoked on the fallthrough path.
Data flow (repro)
User has "Travel WS" (travel enabled) + "No Travel WS" (default, travel disabled).
travelEnabledPolicy resolves to "Travel WS" → shouldShowBookTravel = true, so the Travel button renders.
isTravelReady is derived from "Travel WS"; when it's false, the handler skips the if (isTravelReady) block.
Handler falls through to Navigation.navigate(ROUTES.TRAVEL_MY_TRIPS...) — blockIfDefaultWorkspaceLacksTravel() is never called.
Book Travel RHP opens; no error modal. ← the bug.
What changes do you think we should make in order to solve the problem?
Call blockIfDefaultWorkspaceLacksTravel() at the top of handleBookTravel, before the isTravelReady check, so both exit paths are gated on the default workspace having travel enabled. If it returns true, return early; otherwise continue to the existing isTravelReady / navigate logic.
What alternative solutions did you explore? (Optional)
Re-base travelEnabledPolicy / shouldShowBookTravel / isTravelReady on the default (active) policy (NVP_ACTIVE_POLICY_ID) instead of "any workspace with travel enabled." A traveler is provisioned only against their default workspace (per the hook's own doc comment), so this is the more principled fix — but it's a larger behavioral change and may affect when the button is shown at all. Moving the guard to the top of the handler is the minimal, targeted fix for the reported bug.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/99041) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
Please re-state the problem that we are trying to solve in this issue.
Clicking "Travel" in the Home quick action row does not show the "travel is not enabled on your default workspace" modal when the default workspace has travel disabled. Instead, the Book Travel page opens.
What is the root cause of that problem?
In handleBookTravel the default-workspace guard is wired into only one of the two exit paths:
isTravelReady is derived from travelEnabledPolicy — the first workspace that has travel enabled, not the default one. In the repro "Travel WS" is enabled but not yet provisioned, so hasAcceptedTravelTerms(...) is false and isTravelReady is false. Execution falls through to Navigation.navigate(ROUTES.TRAVEL_MY_TRIPS...) on L213, which opens the Book Travel page for "Travel WS" without ever calling blockIfDefaultWorkspaceLacksTravel(). The guard itself is correct — it checks the active/default policy — it just is not invoked on the fall-through path.
Note on a simpler-looking fix that does not work: moving blockIfDefaultWorkspaceLacksTravel() to the top of the handler and gating both paths unconditionally over-blocks a legitimate flow. The guard returns true whenever the default policy is not isTravelEnabled && hasAcceptedTravelTerms(...), so it treats "travel not enabled" and "travel enabled but terms not accepted yet" identically. A user whose default (and only) workspace has travel enabled but is still finishing setup would get the "enable travel on your default workspace or switch" modal on the quick action and be blocked from reaching the My Trips page to finish setup — even though travel is already enabled on their default. That contradicts PR #98484's own invariant ("Setting up travel on a workspace is unaffected, because only the hand-off into Expensify Travel is blocked"), which is exactly why BookTravelButton calls this guard only on the hasPolicyAcceptedTravelTerms === true branch, never on the setup branches.
What changes do you think we should make in order to solve the problem?
The bug only occurs when the quick action would hand the user off into a non-default travel-enabled workspace while the default lacks travel. So guard the hand-off for the non-default case, and leave the default workspace's own setup navigation untouched.
consthandleBookTravel=useCallback(()=>interceptAnonymousUser(()=>{// A traveler is provisioned against their default workspace, so only block a hand-off that// targets a non-default workspace. Booking against the default itself (including its// still-in-setup state) keeps falling through to the normal flow.constisBookingAgainstDefaultWorkspace=travelEnabledPolicy?.id===activePolicyID;if(!isBookingAgainstDefaultWorkspace&&blockIfDefaultWorkspaceLacksTravel()){return;}if(isTravelReady){openTravelDotLink(travelEnabledPolicy?.id);return;}Navigation.navigate(ROUTES.TRAVEL_MY_TRIPS.getRoute(travelEnabledPolicy?.id));}),[travelEnabledPolicy?.id,isTravelReady,blockIfDefaultWorkspaceLacksTravel,activePolicyID],);
activePolicyID is already read in the component via useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID).
What specific scenarios should we cover in automated tests to prevent reoccurrence of the issue?
Unit test on QuickCreationActionsBarhandleBookTravel:
Default workspace has travel disabled and a different workspace has travel enabled -> blockIfDefaultWorkspaceLacksTravel is invoked and Navigation.navigate(ROUTES.TRAVEL_MY_TRIPS...) / openTravelDotLink are not called (modal path).
Default workspace is the travel-enabled one but terms are not accepted -> guard is not the blocking factor and Navigation.navigate(ROUTES.TRAVEL_MY_TRIPS...) is called (setup path preserved).
Default workspace is travel-enabled and terms accepted -> openTravelDotLink is called with the default policy id and no modal appears.
What alternative solutions did you explore? (Optional)
Re-base the whole quick action on the active/default policy, mirroring TravelMenuItem (the green "+" Book travel item), which already gates visibility and readiness on activePolicy and therefore never books against a non-default workspace. This is the most principled model, but PR #98484 intentionally keeps the quick action button visible and surfaces the modal on click (Scenario 1) rather than hiding it (Scenario 6 for the FAB), so a full re-base changes when the button is shown. The scoped guard above keeps that intended visibility while fixing the missing block, so it is the smaller, lower-risk change.
@rojiphil one thing worth flagging before this moves forward.
The proposal above correctly identifies that the guard is only wired into the isTravelReady branch, but its suggested fix (moving blockIfDefaultWorkspaceLacksTravel() to the top of the handler and gating both paths unconditionally) over-blocks a legitimate flow.
The guard returns true whenever the default policy is not isTravelEnabled && hasAcceptedTravelTerms(...), so it treats "travel not enabled" and "travel enabled but terms not accepted yet" identically. A user whose default (and only) workspace has travel enabled but is still finishing setup would then get the "enable travel on your default workspace or switch" modal on the quick action and be blocked from reaching the My Trips page to finish setup, even though travel is already enabled on their default. That contradicts PR #98484's own invariant that setting up travel is never blocked, which is why BookTravelButton calls this guard only on the hasPolicyAcceptedTravelTerms === true branch, never on the setup branches.
The bug only occurs when the quick action hands off into a non-default travel-enabled workspace while the default lacks travel. So the guard should run only for that non-default hand-off, and the default workspace's own setup navigation should be left untouched:
consthandleBookTravel=useCallback(()=>interceptAnonymousUser(()=>{// A traveler is provisioned against their default workspace, so only block a hand-off that// targets a non-default workspace. Booking against the default itself (including its// still-in-setup state) keeps falling through to the normal flow.constisBookingAgainstDefaultWorkspace=travelEnabledPolicy?.id===activePolicyID;if(!isBookingAgainstDefaultWorkspace&&blockIfDefaultWorkspaceLacksTravel()){return;}if(isTravelReady){openTravelDotLink(travelEnabledPolicy?.id);return;}Navigation.navigate(ROUTES.TRAVEL_MY_TRIPS.getRoute(travelEnabledPolicy?.id));}),[travelEnabledPolicy?.id,isTravelReady,blockIfDefaultWorkspaceLacksTravel,activePolicyID],);
Default workspace has travel enabled but terms not yet accepted: target == default -> guard skipped -> falls through to My Trips so setup can be finished. Preserves Scenario 5.
Full write-up with test scenarios and the alternative (re-basing the quick action on the active policy like TravelMenuItem) is in my proposal above.
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributorImprovementItem broken or needs improvement.ReviewingHas a PR in review
Activity
applause-bot commentedon Aug 20, 2026
While Applause doesn't embed attachments for this bug, here are the links for quick view:
https://platform.applause.com/services/links/v1/external/e098d3164a1c9b8c6950ad9ae744338d5fc09b0ee400835e5cfa5049c57817de
MelvinBot commentedon Aug 20, 2026
Proposal
What is the root cause of that problem?
The default-workspace travel guard is only wired into one branch of the Home quick-action Travel handler, so the "not enabled on your default workspace" modal is skipped on the path that opens the Book Travel RHP.
In
handleBookTravel,blockIfDefaultWorkspaceLacksTravel()is called only insideif (isTravelReady). WhenisTravelReadyis false, execution falls through toNavigation.navigate(ROUTES.TRAVEL_MY_TRIPS...), which opens the Book Travel RHP without ever calling the guard — so no error modal appears. This is exactly the reported symptom.A second, contributing flaw:
travelEnabledPolicyisObject.values(allPolicies).find((p) => p?.isTravelEnabled)— the first workspace with travel enabled, not the default/active one. So with "Travel WS" enabled, the button shows and books against that workspace even though the default "No Travel WS" has travel disabled. The guard itself is correct —useDefaultWorkspaceTravelGuardchecks the active policy (NVP_ACTIVE_POLICY_ID) — it just isn't invoked on the fallthrough path.Data flow (repro)
travelEnabledPolicyresolves to "Travel WS" →shouldShowBookTravel = true, so the Travel button renders.isTravelReadyis derived from "Travel WS"; when it's false, the handler skips theif (isTravelReady)block.Navigation.navigate(ROUTES.TRAVEL_MY_TRIPS...)—blockIfDefaultWorkspaceLacksTravel()is never called.What changes do you think we should make in order to solve the problem?
Call
blockIfDefaultWorkspaceLacksTravel()at the top ofhandleBookTravel, before theisTravelReadycheck, so both exit paths are gated on the default workspace having travel enabled. If it returnstrue, return early; otherwise continue to the existingisTravelReady/ navigate logic.What alternative solutions did you explore? (Optional)
Re-base
travelEnabledPolicy/shouldShowBookTravel/isTravelReadyon the default (active) policy (NVP_ACTIVE_POLICY_ID) instead of "any workspace with travel enabled." A traveler is provisioned only against their default workspace (per the hook's own doc comment), so this is the more principled fix — but it's a larger behavioral change and may affect when the button is shown at all. Moving the guard to the top of the handler is the minimal, targeted fix for the reported bug.Possibly related issues
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/99041)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run
melvin-bot commentedon Aug 20, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @rojiphil (
External)melvin-bot commentedon Aug 20, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022090357152953872658
David-2002065 commentedon Aug 20, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
Clicking "Travel" in the Home quick action row does not show the "travel is not enabled on your default workspace" modal when the default workspace has travel disabled. Instead, the Book Travel page opens.
What is the root cause of that problem?
In
handleBookTravelthe default-workspace guard is wired into only one of the two exit paths:isTravelReadyis derived fromtravelEnabledPolicy— the first workspace that has travel enabled, not the default one. In the repro "Travel WS" is enabled but not yet provisioned, sohasAcceptedTravelTerms(...)isfalseandisTravelReadyisfalse. Execution falls through toNavigation.navigate(ROUTES.TRAVEL_MY_TRIPS...)on L213, which opens the Book Travel page for "Travel WS" without ever callingblockIfDefaultWorkspaceLacksTravel(). The guard itself is correct — it checks the active/default policy — it just is not invoked on the fall-through path.Note on a simpler-looking fix that does not work: moving
blockIfDefaultWorkspaceLacksTravel()to the top of the handler and gating both paths unconditionally over-blocks a legitimate flow. The guard returnstruewhenever the default policy is notisTravelEnabled && hasAcceptedTravelTerms(...), so it treats "travel not enabled" and "travel enabled but terms not accepted yet" identically. A user whose default (and only) workspace has travel enabled but is still finishing setup would get the "enable travel on your default workspace or switch" modal on the quick action and be blocked from reaching the My Trips page to finish setup — even though travel is already enabled on their default. That contradicts PR #98484's own invariant ("Setting up travel on a workspace is unaffected, because only the hand-off into Expensify Travel is blocked"), which is exactly whyBookTravelButtoncalls this guard only on thehasPolicyAcceptedTravelTerms === truebranch, never on the setup branches.What changes do you think we should make in order to solve the problem?
The bug only occurs when the quick action would hand the user off into a non-default travel-enabled workspace while the default lacks travel. So guard the hand-off for the non-default case, and leave the default workspace's own setup navigation untouched.
In
handleBookTravel:activePolicyIDis already read in the component viauseOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID).Result:
What specific scenarios should we cover in automated tests to prevent reoccurrence of the issue?
Unit test on
QuickCreationActionsBarhandleBookTravel:blockIfDefaultWorkspaceLacksTravelis invoked andNavigation.navigate(ROUTES.TRAVEL_MY_TRIPS...)/openTravelDotLinkare not called (modal path).Navigation.navigate(ROUTES.TRAVEL_MY_TRIPS...)is called (setup path preserved).openTravelDotLinkis called with the default policy id and no modal appears.What alternative solutions did you explore? (Optional)
Re-base the whole quick action on the active/default policy, mirroring
TravelMenuItem(the green "+" Book travel item), which already gates visibility and readiness onactivePolicyand therefore never books against a non-default workspace. This is the most principled model, but PR #98484 intentionally keeps the quick action button visible and surfaces the modal on click (Scenario 1) rather than hiding it (Scenario 6 for the FAB), so a full re-base changes when the button is shown. The scoped guard above keeps that intended visibility while fixing the missing block, so it is the smaller, lower-risk change.David-2002065 commentedon Aug 20, 2026
@rojiphil one thing worth flagging before this moves forward.
The proposal above correctly identifies that the guard is only wired into the
isTravelReadybranch, but its suggested fix (movingblockIfDefaultWorkspaceLacksTravel()to the top of the handler and gating both paths unconditionally) over-blocks a legitimate flow.The guard returns
truewhenever the default policy is notisTravelEnabled && hasAcceptedTravelTerms(...), so it treats "travel not enabled" and "travel enabled but terms not accepted yet" identically. A user whose default (and only) workspace has travel enabled but is still finishing setup would then get the "enable travel on your default workspace or switch" modal on the quick action and be blocked from reaching the My Trips page to finish setup, even though travel is already enabled on their default. That contradicts PR #98484's own invariant that setting up travel is never blocked, which is whyBookTravelButtoncalls this guard only on thehasPolicyAcceptedTravelTerms === truebranch, never on the setup branches.The bug only occurs when the quick action hands off into a non-default travel-enabled workspace while the default lacks travel. So the guard should run only for that non-default hand-off, and the default workspace's own setup navigation should be left untouched:
Full write-up with test scenarios and the alternative (re-basing the quick action on the active policy like
TravelMenuItem) is in my proposal above.blimpich commentedon Aug 20, 2026
I'm looking into this. It's a follow up from my PR.
55 remaining items
melvin-bot commentedon Nov 8, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Nov 8, 2026
Payment Summary
Resolving PRs:
Explain when the default workspace blocks booking travel #99092
Reviewer: @huult owed $175 via NewDot
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Nov 11, 2026
Payment Summary
Contributor+: @huult due $250 via NewDot
huult commentedon Nov 12, 2026
@mallenexpensify Could you check this comment? It should be $250.
huult commentedon Nov 12, 2026
I reopened this ticket because we need to update the payment summary cc @mallenexpensify
mallenexpensify commentedon Nov 12, 2026
@huult payment summary updated, apologies for missing it, thx for reopening
JmillsExpensify commentedon Nov 15, 2026
$250 approved for @huult