Skip to content

Revert preventSpotnanaTravel resolution to raw betas - #100866

Closed
arekm213 wants to merge 2 commits into
Expensify:mainfrom
arekm213:arekm213/fix/revert-spotnana-beta-resolution
Closed

arekm213 wants to merge 2 commits into
Expensify:mainfrom
arekm213:arekm213/fix/revert-spotnana-beta-resolution

Conversation

@arekm213

@arekm213 arekm213 commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Reverts the preventSpotnanaTravel part of #99444.

That PR moved three travel call sites (TravelMenuItem, QuickCreationActionsBar, useCreateNavigationSuggestions) from Permissions.isBetaEnabled(beta, allBetas) to usePermissions().isBetaEnabled(beta). usePermissions applies betaConfiguration, and preventSpotnanaTravel is an exclusion beta, so on accounts that only have the all beta it now resolves to false and those entry points stopped blocking travel.

This restores the previous two argument resolution at those three sites, plus the test mock that covers it. The other four call sites (BookTravelButton, BookOrManageYourTrip, DynamicTripDetailsPage, TermsStep) already resolved through usePermissions before #99444 and are untouched.

Note this puts the beta back to resolving two different ways in the app. The consistent behaviour is the correct end state, so the follow up is on the testing side: to exercise travel blocking, the account needs preventSpotnanaTravel set explicitly rather than relying on all.

Fixed Issues

$ #100851
PROPOSAL:

Tests

Precondition: a paid group workspace provisioned for travel with travel terms accepted, set as the active workspace.

  1. Sign in with an account that has the all beta and does not have preventSpotnanaTravel set explicitly
  2. Open the FAB, verify the Travel item has no "open in new tab" icon, tap it, verify it opens My Trips inside the app
  3. Open Search, type "travel", select the Travel suggestion, verify it opens My Trips inside the app
  4. Sign in with an account that has neither all nor preventSpotnanaTravel, repeat steps 2 and 3, verify both open TravelDot in a new tab
  • Verify that no errors appear in the JS console

Offline tests

Same as tests. Beta resolution reads Onyx only, there is no network behaviour involved.

QA Steps

Same as tests.

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

@melvin-bot

melvin-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

@Eskalifer1 @DylanDylann One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot
melvin-bot Bot removed request for a team September 10, 2026 15:53
@codecov

codecov Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.

Files with missing lines Coverage Δ
...nents/Navigation/QuickCreationActionsBar/index.tsx 92.13% <100.00%> (ø)
...rch/SearchRouter/useCreateNavigationSuggestions.ts 98.71% <ø> (-1.29%) ⬇️
...bar/FABPopoverContent/menuItems/TravelMenuItem.tsx 4.34% <0.00%> (ø)
... and 48 files with indirect coverage changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b406cace47

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

const [primaryLogin] = useOnyx(ONYXKEYS.ACCOUNT, {selector: primaryLoginSelector});
const [sessionEmail] = useOnyx(ONYXKEYS.SESSION, {selector: emailSelector});
const isBlockedFromSpotnanaTravel = isBetaEnabled(CONST.BETAS.PREVENT_SPOTNANA_TRAVEL);
const isBlockedFromSpotnanaTravel = Permissions.isBetaEnabled(CONST.BETAS.PREVENT_SPOTNANA_TRAVEL, allBetas);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve beta overrides in the travel gate

In non-production, when a tester force-enables preventSpotnanaTravel from Troubleshoot while the account's server betas do not include it, this two-argument call still returns false because Permissions.isBetaEnabled only reads overrides from its fourth argument, whereas the removed usePermissions call supplied them. The FAB item consequently calls openTravelDotLink instead of exercising the blocked flow; the same regression exists in QuickCreationActionsBar and useCreateNavigationSuggestions. Preserve the override input while intentionally bypassing betaConfiguration.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its exactly how it used to work before this PR

const shouldShowBookTravel = !!travelEnabledPolicy;

const isBlockedFromSpotnanaTravel = isBetaEnabled(CONST.BETAS.PREVENT_SPOTNANA_TRAVEL);
const isBlockedFromSpotnanaTravel = Permissions.isBetaEnabled(CONST.BETAS.PREVENT_SPOTNANA_TRAVEL, allBetas);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use isBetaEnabled from usePermissions to avoid redundant subscriptions. We only need to add one flag to determine whether betaConfiguration needs to be passed or not.

@DylanDylann

Copy link
Copy Markdown
Contributor

@arekm213 Please check #99444 again to see if the same problem happens anywhere else where we pass betaConfiguration redundantly. And fix it too

@arekm213

Copy link
Copy Markdown
Contributor Author

closing this PR
in the end we decided we shouldn't revert that because this change improved how production works for users with all beta - original issue was closed too

@arekm213 arekm213 closed this Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants