Skip to content

Fix: Onboarding - "Getting started" section is missing after selecting Other accounting system#95311

Merged
inimaga merged 13 commits into
Expensify:mainfrom
annaweber830:fix/94135-getting-started-section
Jul 9, 2026
Merged

Fix: Onboarding - "Getting started" section is missing after selecting Other accounting system#95311
inimaga merged 13 commits into
Expensify:mainfrom
annaweber830:fix/94135-getting-started-section

Conversation

@annaweber830

@annaweber830 annaweber830 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

The actual cause is a timezone bug: firstDayFreeTrial is a UTC DB timestamp with no offset, but isWithinGettingStartedPeriod parsed it with new Date(...), which reads a timezone-less string as local time. For any user west of UTC, that puts the trial start in the future for the first few hours after signup → elapsed < 0 → the "Getting started" section is hidden.

The fix parses it as UTC (fromZonedTime(..., 'UTC')) on the read side, and writes the optimistic trial dates in UTC on the write side (Policy.ts) so a pending/offline upgrade doesn't leave a local-clock string (which skews users east of UTC).

Repro: set the device TZ to America/Los_Angeles, sign up, open Home immediately — missing before the fix, present after. I've added a full write-up to the OP.

Fixed Issues

$ #94135

PROPOSAL: #94135 (comment)

Tests

  1. Launch Expensify App
  2. Log in with valid credentials
  3. Sign up/onboard via "Manage my team's expenses"
  4. Select "Other" as the accounting system
  5. Keep the Accounting feature enabled on the Interested Features step
  6. Complete the onboarding flow
  7. Open the workspace home page
  8. Look for the "Getting started" section
  • Verify that no errors appear in the JS console

Offline tests

Same as tests

QA Steps

// TODO: These must be filled out, or the issue title must include "[No QA]."

  1. Launch Expensify App
  2. Log in with valid credentials
  3. Sign up/onboard via "Manage my team's expenses"
  4. Select "Other" as the accounting system
  5. Keep the Accounting feature enabled on the Interested Features step
  6. Complete the onboarding flow
  7. Open the workspace home page
  8. Look for the "Getting started" section
  • 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 any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • 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 any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • 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
94135-android-AFTER.mp4
Android: mWeb Chrome
94135-mweb-chrome-device.mp4
iOS: Native
94135-ios-AFTER-fullflow.mp4
iOS: mWeb Safari
94135-mweb-safari.mp4
MacOS: Chrome / Safari
94135-AFTER-fixed.mp4

@annaweber830 annaweber830 requested review from a team as code owners July 3, 2026 21:51
@melvin-bot melvin-bot Bot requested review from trjExpensify and youssef-lr and removed request for a team July 3, 2026 21:51
@melvin-bot

melvin-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown

@youssef-lr Please 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]

@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: 79e4e148b1

ℹ️ 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".

@codecov

codecov Bot commented Jul 3, 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 Δ
src/libs/actions/Policy/Policy.ts 69.90% <100.00%> (-0.29%) ⬇️
...artedSection/utils/isWithinGettingStartedPeriod.ts 88.88% <66.66%> (-11.12%) ⬇️
... and 14 files with indirect coverage changes

@trjExpensify trjExpensify left a comment

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.

Can you write a description of the changes you're making in this PR under the section in the OP of the checklist for that?

I don't know how this has anything to do with clicking "Other" accounting system. 🤔

@annaweber830

Copy link
Copy Markdown
Contributor Author

Thanks @trjExpensify! You're right that the accounting choice is a red herring — "Other accounting system" is just the path in the reporter's repro; the section disappearing has nothing to do with it.

The actual cause is a timezone bug: firstDayFreeTrial is a UTC DB timestamp with no offset, but isWithinGettingStartedPeriod parsed it with new Date(...), which reads a timezone-less string as local time. For any user west of UTC, that puts the trial start in the future for the first few hours after signup → elapsed < 0 → the "Getting started" section is hidden.

The fix parses it as UTC (fromZonedTime(..., 'UTC')) on the read side, and writes the optimistic trial dates in UTC on the write side (Policy.ts) so a pending/offline upgrade doesn't leave a local-clock string (which skews users east of UTC).

Repro: set the device TZ to America/Los_Angeles, sign up, open Home immediately — missing before the fix, present after. I've added a full write-up to the OP. 🙏

@huult

huult commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot I'm the C+ for this PR. Could you assign me as a reviewer for it?

@huult

huult commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

@annaweber830, could you please add the information from #95311 (comment) to the Explanation of Change section of the PR checklist?

@MelvinBot MelvinBot requested a review from huult July 7, 2026 01:31
@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 Done — I've added huult as a requested reviewer on this PR.

@annaweber830

Copy link
Copy Markdown
Contributor Author

Hi @huult I updated PR.

@huult

huult commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 615bc811af

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@huult

huult commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible 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 checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • 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 verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • 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 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.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this 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.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Screen.Recording.2026-07-08.at.14.28.24.mov
Android: mWeb Chrome
Screen.Recording.2026-07-08.at.14.30.31.mov
iOS: HybridApp
Screen.Recording.2026-07-08.at.14.35.12.mov
iOS: mWeb Safari
Screen.Recording.2026-07-08.at.14.35.51.mov
MacOS: Chrome / Safari
Screen.Recording.2026-07-08.at.14.24.15.mov

2

@huult

huult commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

@annaweber830 Could you add a unit test for this case? For example, mock TZ=America/Los_Angeles, set firstDayFreeTrial to approximately now (UTC), and assert that isWithinGettingStartedPeriod returns true.

@huult

huult commented Jul 8, 2026

Copy link
Copy Markdown
Contributor
Screen.Recording.2026-07-08.at.14.18.49.mov
Screen.Recording.2026-07-08.at.14.24.15.mov

I used Playwright to reproduce this issue and confirmed that the change fixes it and works as expected. I'm just waiting for @annaweber830 to add a unit test before I can approve the PR.

@annaweber830

Copy link
Copy Markdown
Contributor Author

Hi @huult I updated PR.

@huult

huult commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

@annaweber830 Could you please check the failed checks?

@annaweber830

Copy link
Copy Markdown
Contributor Author

Hi @huult I updated my PR. Please check

@huult

huult commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Why do we need tests/unit/RateTest.ts here? I think it should be removed.

@annaweber830

Copy link
Copy Markdown
Contributor Author

Hi @huult I updated my PR again.

Comment thread tests/unit/pages/home/GettingStartedSection/isWithinGettingStartedPeriodTest.ts Outdated
@annaweber830

Copy link
Copy Markdown
Contributor Author

Hi @huult I removed code. please check

@huult huult left a comment

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.

Issue:

Screen.Recording.2026-07-08.at.14.18.49.mov

Fix:

Screen.Recording.2026-07-08.at.14.24.15.mov

LGTM.

inimaga
inimaga previously approved these changes Jul 9, 2026
@inimaga

inimaga commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

@annaweber830 we've got ESLint failures. Could you merge main in?

@annaweber830 annaweber830 force-pushed the fix/94135-getting-started-section branch from 1266039 to 1c07bd1 Compare July 9, 2026 10:29
@annaweber830

Copy link
Copy Markdown
Contributor Author

Hi @inimaga
The ESLint CI failure is not caused by this PR. My changes only touch:

  • src/pages/home/GettingStartedSection/utils/isWithinGettingStartedPeriod.ts
  • src/libs/actions/Policy/Policy.ts

The failing lint errors are in src/libs/actions/Report/index.ts and tests/actions/IOUTest/SplitTest.ts — neither of which this PR touches. The eslint-seatbelt message shows the violation count exceeded the grandfathered limit due to changes in main unrelated to this PR. This is a pre-existing issue on main.

@inimaga

inimaga commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Yeah. The lint failure is on main and affecting other PRs as well. Hold for now.

@inimaga

inimaga commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

@annaweber830 Could you merge main in again? The lint issues should now be fixed by this PR: #95671

@annaweber830

Copy link
Copy Markdown
Contributor Author

thanks. I will merge

@annaweber830

Copy link
Copy Markdown
Contributor Author

Hi @inimaga I merged main.

@inimaga inimaga merged commit 765abb8 into Expensify:main Jul 9, 2026
34 checks passed
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🚧 inimaga has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

OSBotify commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/inimaga in version: 9.4.33-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 cancelled 🔪

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 Help site review: no changes required.

This PR is a timezone parsing bug fix, not a behavior or UI change. It corrects how the trial start date is parsed/written so the Getting started section on Home appears when it's supposed to — it does not change the conditions under which that section shows, nor any feature names, tab names, settings labels, or buttons.

The existing help article already documents the intended behavior accurately, so the fix brings the app back into line with the docs rather than requiring an update:

Both already state the section appears only when the user selected manage my team / track and budget my expenses, is within the free-trial window, and has an active paid workspace — all still correct after this fix. No new or changed user-facing concept, label, or step is introduced.

Because no documentation update is needed, I have not created a draft help site PR.

@annaweber830, please confirm you agree no help site changes are needed here. If you'd like an article updated anyway (e.g. to clarify the trial-window behavior), reply with @MelvinBot and I'll draft one.

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.

6 participants