Skip to content

Fix monthly Next Step submit date shifting one day back in UTC-negative timezones - #98132

Merged
iwiznia merged 7 commits into
mainfrom
claude-monthlyNextStepDateOffByOne
Aug 18, 2026
Merged

iwiznia merged 7 commits into
mainfrom
claude-monthlyNextStepDateOffByOne

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

The monthly automatic-submit date shown in the Next Step banner was rendered one day earlier than the day configured in Workspace Settings → Workflows, for any user in a UTC-negative timezone (e.g. all of the Americas).

The ETA is built and serialized correctly in local time as a date-only string (yyyy-MM-dd) in buildOptimisticNextStep. The bug was purely in the render path in buildNextStepMessage: it re-parsed that date-only string with native new Date('2026-08-15'), which the ECMAScript spec parses as UTC midnight. date-fns format() then renders in the browser's local time, so in a UTC-negative timezone UTC midnight of the 15th is 19:00 on the 14th local — and the 'do' ordinal prints "14th".

This change parses the date-only string with date-fns parseISO, which parses it as local midnight (same pattern already used in DistanceRequestUtils), so the rendered day matches the configured day in every timezone. The stored setting was never at fault.

Fixed Issues

$ #97875
PROPOSAL: #97875 (comment)

Tests

  1. Open App
  2. Login with new gmail account
  3. Create new workspace
  4. Go to Workspace settings > Workflows
  5. Enable Submissions
  6. Set Submission frequency to Monthly
  7. Select any day of the month (1 - 31)
  8. Go to Workspace and create expense (no submit)
  9. Check submission date in Next Step banner
  10. Verify that monthly submission date in Next Step banner should match the date specified in the workspace settings.
  • Verify that no errors appear in the JS console

Offline tests

QA Steps

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

  • 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

…ve timezones

Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>
@ZhenjaHorbach

Copy link
Copy Markdown
Contributor

@MelvinBot
Add tests for different time zones

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 I looked into the failing checks — there's nothing to fix in code. Every code/test check is green (typecheck, ESLint, Bun tests, all 8 test jobs, Storybook, build, and both perf-test jobs).

The only two failing checks are process gates that require human action, not a code push:

  • PR Author Checklist / checklist — fails because the author checklist boxes above are still unchecked. Complete and check them off.
  • Check independent approval — fails because the PR hasn't received an independent reviewer approval yet.

Both clear on their own once the checklist is completed and the PR gets its independent approval, so I'm not pushing any changes.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Re-checked — the state is unchanged from my previous comment. All code/test checks are still green; the only two failing checks are process gates, not code:

  • PR Author Checklist / checklist — the author checklist boxes above are still unchecked. Complete and check them off.
  • Check independent approval — waiting on an independent reviewer approval.

There's nothing for me to fix in code, so I'm not pushing any changes. Both clear once the checklist is completed and the PR gets its independent approval.

Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Added cross-timezone tests for the monthly Next Step submit date in tests/unit/NextStepUtilsTest.ts and pushed to this branch. They render the same 2026-08-15 date-only eta across UTC+14 → UTC-10 and assert it always shows the 15th, and each UTC-negative case also asserts the old parsing rendered the 14th — locking in the exact regression this PR fixes.

Why it runs date parsing in a child process: the natural approach — set process.env.TZ per case and call buildNextStepMessage — silently does nothing here. Our Jest suite is pinned to TZ=utc and V8 caches the timezone at process start, so reassigning process.env.TZ at runtime doesn't take effect (I verified: even with the old buggy new Date(...), an in-process America/New_York case still rendered the 15th and passed — a false-green test). UTC is also the one zone where the bug is invisible, since UTC midnight and local midnight coincide. So each case runs the same format(parseISO(...), 'do') / format(new Date(...), 'do') expression in a short-lived node child with a real TZ, where the offset genuinely applies.

Verification & known limitation
  • Against the shipped fix: all 7 timezone cases pass (~55ms each); full file is 44/44 green.
  • Teeth check: temporarily reverting NextStepUtils.ts:86 to new Date(...) makes the UTC-negative legacy assertions the tripwire — the legacy === '14th' assertion also guarantees the child really switched zones, so the test can't quietly degrade into a UTC-only no-op the way the process.env.TZ version did.
  • npm run typecheck-tsgo and ESLint on the file are clean (0 new errors).
  • Limitation: the child mirrors the one-line parse+format expression from buildNextStepMessage rather than importing the function (the full module graph can't load in a bare node child, and spawning a whole Jest run per zone would add ~10s each to the suite). The sibling in-process test renders a monthly automatic-submit eta using the day-of-month it encodes… still exercises the real function's wiring (in UTC). A source regression back to new Date would therefore be caught by the mirrored expression + the pinned NextStepUtils.ts:86 comment, but not by an automated negative-zone run of the real function — that gap is inherent to the UTC-locked Jest env and would only close with a timezone-injectable formatter or a multi-TZ CI run.

@ZhenjaHorbach

Copy link
Copy Markdown
Contributor

@MelvinBot
Fix spellcheck

Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Fixed the failing spellcheck check.

The new cross-timezone test commit added 'Pacific/Kiritimati' (a UTC+14 timezone) to the it.each table in tests/unit/NextStepUtilsTest.ts:1149, and cspell flagged Kiritimati as an unknown word. I added a // cspell:ignore Kiritimati directive at the top of the file — the same inline pattern already used in other test files (e.g. UserAvatarUtilsTest.ts, searchMatchUtilsTest.ts).

The remaining PR Author Checklist / checklist and Check independent approval failures are process gates that require human action (completing the checklist and getting an independent approval), not code fixes.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

Spellcheck is now passing ✅

The failure was cspell flagging the IANA timezone name Kiritimati (from Pacific/Kiritimati, the UTC+14 case in the cross-timezone tests) as an unknown word. It's now allow-listed with a // cspell:ignore Kiritimati directive at the top of tests/unit/NextStepUtilsTest.ts.

Verified locally (npm run spell-changed → 0 issues) and the spellcheck CI check is green on the latest commit.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Checked again — nothing changed and there is nothing for me to push.

Every code/test check is green (typecheck, ESLint, Bun tests, all 8 test jobs, Storybook, build, and both perf-test jobs). The spellcheck failure from the earlier test commit is already fixed.

The only two failing checks are process gates that I cannot resolve with a code change, and re-running me won't clear them:

  • PR Author Checklist / checklist → ZhenjaHorbach, please complete and tick the author-checklist boxes in the PR description.
  • Check independent approval → needs an independent reviewer to approve the PR.

Once those two human steps are done, both checks turn green. There's no code fix outstanding on this PR.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Nothing has changed since my previous comment — the checks re-ran and every code/test check is still green. The two remaining failures are the same non-code process gates, which I can't fix with a push:

  • PR Author Checklist / checklist — the author checklist boxes above are still unchecked. Complete and check them off.
  • Check independent approval — waiting on an independent reviewer approval.

Both clear once the checklist is completed and the PR gets its independent approval.

@ZhenjaHorbach

Copy link
Copy Markdown
Contributor

@MelvinBot
Just don't use Kiritimati

Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Done — dropped Pacific/Kiritimati from the timezone matrix and removed the // cspell:ignore Kiritimati directive it required, so no spellcheck allow-listing is needed anymore. Positive/zero/negative offset coverage is preserved via Tokyo (+9), Paris (+1/+2), UTC, New York (-4/-5), LA (-7/-8), and Honolulu (-10). All 6 cases pass and the full file is green.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Re-checked after the latest CI run — the result is unchanged, and there's still nothing to fix in code. Every code/test check is green (typecheck, ESLint, Bun tests, all 8 test jobs, Storybook, knip, and both perf-test jobs).

The only two failing checks are process gates that require human action, not a code push:

  • PR Author Checklist / checklist — fails because the author checklist boxes above are still unchecked. Complete and check them off.
  • Check independent approval — fails because the PR hasn't received an independent reviewer approval yet.

Both clear on their own once the checklist is completed and the PR gets its independent approval, so I'm not pushing any changes.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Re-checked — the situation is unchanged from my previous comment. All code and test checks are green; the only two failing checks are process gates that require human action, not a code fix:

  • PR Author Checklist / checklist — the author checklist boxes above are still unchecked. Complete and check them off.
  • Check independent approval — the PR still needs an independent reviewer approval.

There's nothing for me to push. Both clear on their own once the checklist is completed and the PR gets its independent approval.

@ZhenjaHorbach

Copy link
Copy Markdown
Contributor

@MelvinBot
Fix conflicts

…pDateOffByOne

Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>

# Conflicts:
#	src/libs/NextStepUtils.ts
@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Merged main and resolved the conflict — the PR is mergeable again.

Where it conflicted: src/libs/NextStepUtils.ts:88, the eta-formatting line in buildNextStepMessage. Both sides changed the same format(...) call:

  • This PR: swapped new Date(...) → parseISO(...) (the timezone off-by-one fix).
  • main: added a {locale: dateFnsLocale} option to the format() call.

Resolution: combined both — kept parseISO and the locale option:

eta = format(parseISO(nextStep.eta.dateTime), formatString, {locale: dateFnsLocale});

parseISO was already imported and dateFnsLocale is an in-scope parameter, so no other edits were needed. tests/unit/NextStepUtilsTest.ts auto-merged cleanly and the timezone regression tests added by this PR are intact.

⚠️ I couldn't run the local test suite in this environment (npm/jest aren't available to me here). The resolution is a mechanical union of two already-reviewed one-liners with all identifiers confirmed in scope, so it should be safe — but please let CI validate before merging.

@MelvinBot

Copy link
Copy Markdown
Contributor Author

⚠️ MelvinBot CI Fix Loop Detected

MelvinBot has made 5 consecutive commits trying to fix CI failures. Automatic CI fix dispatches are now paused for this PR.

Next steps: A human should review the recent commits and resolve the conflicting CI errors manually.

@ZhenjaHorbach

Copy link
Copy Markdown
Contributor

@MelvinBot
Fix tests and then open the PR

…in merge

Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>
@MelvinBot
MelvinBot marked this pull request as ready for review August 14, 2026 09:28
@MelvinBot
MelvinBot requested a review from a team as a code owner August 14, 2026 09:28
@melvin-bot
melvin-bot Bot removed request for a team August 14, 2026 09:28
@melvin-bot

melvin-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

@ZhenjaHorbach 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]

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Fixed the failing checks and marked the PR ready for review.

Root cause: The main merge added a dateFnsLocale parameter (position 3) to buildNextStepMessage, but this PR's timezone test at tests/unit/NextStepUtilsTest.ts:1157 still called it with the old 4-arg shape. That made 999999 land in the dateFnsLocale slot and formatPhoneNumber land in the currentUserAccountID slot — causing both failures:

  • typecheck: TS2554: Expected 5 arguments, but got 4.
  • test (job 3): TypeError: formatPhoneNumber is not a function (it was undefined because the args were shifted).

Fix: Inserted undefined for dateFnsLocale, matching the three other buildNextStepMessage calls in the same describe block:

const message = buildNextStepMessage(nextStep, translateEta, undefined, 999999, formatPhoneNumber);

The remaining checklist and Check independent approval checks are the standard human-review gates, not code failures. CI is re-running on the new commit.

@ZhenjaHorbach

Copy link
Copy Markdown
Contributor

@MelvinBot
Complete author checklist

Comment thread tests/unit/NextStepUtilsTest.ts Outdated
describe('renders a monthly automatic-submit eta on the encoded day of month in every timezone', () => {
// `buildNextStepMessage` renders a date-only `eta.dateTime` with date-fns, which uses the ambient system
// timezone. Jest is pinned to UTC (`TZ=utc`) and V8 caches that at process start, so we cannot change the
// timezone from inside this process — UTC is also the one zone where the bug is invisible, because UTC

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.

❌ CONSISTENCY-16 (docs)

This newly added comment uses an em dash (—) to join two clauses. Per the plain-comment-style rule, comments should read as plain sentences without em/en dashes; split the thought into two sentences instead.

Rewrite the comment so the em dash becomes a sentence break, e.g.:

// timezone. Jest is pinned to UTC (`TZ=utc`) and V8 caches that at process start, so we cannot change the
// timezone from inside this process. UTC is also the one zone where the bug is invisible, because UTC
// midnight and local midnight coincide.

Reviewed at: 43dfa68 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.

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.

Done in 994bc25 — split the em dash into a sentence break: "...timezone from inside this process. UTC is also the one zone where the bug is invisible..."

Comment thread tests/unit/NextStepUtilsTest.ts Outdated
expect(fixed).toBe('15th');

// In UTC-negative zones the old `new Date` parsing shifts the day back by one. Asserting it here both
// documents the regression and guarantees the child really ran in a UTC-negative zone — otherwise this

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.

❌ CONSISTENCY-16 (docs)

This newly added comment uses an em dash (—) to join two clauses. Per the plain-comment-style rule, comments should read as plain sentences without em/en dashes; split the thought into two sentences instead.

Rewrite the comment so the em dash becomes a sentence break, e.g.:

// In UTC-negative zones the old `new Date` parsing shifts the day back by one. Asserting it here both
// documents the regression and guarantees the child really ran in a UTC-negative zone. Otherwise this
// would read '15th' and fail loudly instead of the test silently degrading into a UTC-only no-op.

Reviewed at: 43dfa68 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.

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.

Done in 994bc25 — split the em dash into a sentence break: "...guarantees the child really ran in a UTC-negative zone. Otherwise this would read '15th'..."

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 I can't complete the author checklist for you — most of it is a human attestation I'm not able to make truthfully.

The PR Author Checklist / checklist items certify manual work that I didn't (and can't) do from here, e.g.:

  • "I ran the tests on all platforms & verified they passed" (Android/iOS Native, mWeb, Desktop)
  • "I included screenshots or videos for tests on all platforms"
  • "I turned off my network connection and tested it while offline"
  • "I tested this PR with a High Traffic account against staging/production"

Checking these off on your behalf would be a false attestation, so they need to be completed by the author/assignee who actually performs those steps. The Tests / QA Steps sections are also human-owned and shouldn't be filled in by me.

What I can confirm about this PR:

Once you've run through the platforms and filled in the Tests/QA steps, check the boxes and the checklist action will go green.

@ZhenjaHorbach

Copy link
Copy Markdown
Contributor

@MelvinBot
Fix comments

Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>
@MelvinBot
MelvinBot requested a review from a team as a code owner August 14, 2026 09:40
@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Addressed both CONSISTENCY-16 review comments in 994bc25 — split the two em-dash comments in tests/unit/NextStepUtilsTest.ts into plain sentences (no em/en dashes). Comment-only changes; no logic touched. I re-scanned both changed files and there are no remaining em/en dashes in comments.

@melvin-bot
melvin-bot Bot requested review from neil-marcellini and removed request for a team August 14, 2026 09:41
@melvin-bot

melvin-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

@neil-marcellini 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]

@ZhenjaHorbach

Copy link
Copy Markdown
Contributor

@MelvinBot
Paste this into the the PR description

<!-- If necessary, assign reviewers that know the area or changes well. Feel free to tag any additional reviewers you see fit. -->

### Explanation of Change

The monthly automatic-submit date shown in the Next Step banner was rendered one day earlier than the day configured in Workspace Settings → Workflows, for any user in a UTC-negative timezone (e.g. all of the Americas).

The ETA is built and serialized correctly in local time as a date-only string (`yyyy-MM-dd`) in `buildOptimisticNextStep`. The bug was purely in the render path in `buildNextStepMessage`: it re-parsed that date-only string with native `new Date('2026-08-15')`, which the ECMAScript spec parses as **UTC midnight**. `date-fns` `format()` then renders in the browser's local time, so in a UTC-negative timezone UTC midnight of the 15th is 19:00 on the 14th local — and the `'do'` ordinal prints "14th".

This change parses the date-only string with `date-fns` `parseISO`, which parses it as **local** midnight (same pattern already used in `DistanceRequestUtils`), so the rendered day matches the configured day in every timezone. The stored setting was never at fault.

### Fixed Issues
<!---
1. Please postfix `$` with a URL link to the GitHub issue this Pull Request is fixing. For example, `$ https://github.com/Expensify/App/issues/<issueID>`.
2. Please postfix  `PROPOSAL:` with a URL link to your GitHub comment, which contains the approved proposal (i.e. the proposal that was approved by Expensify).  For example, `PROPOSAL: https://github.com/Expensify/App/issues/<issueID>#issuecomment-1369752925`

Do NOT add the special GH keywords like `fixed` etc, we have our own process of managing the flow.
It MUST be an entire link to the github issue and your comment proposal ; otherwise, the linking and its automation will not work as expected.

Make sure this section looks similar to this (you can link multiple issues using the same formatting, just add a new line):

$ https://github.com/Expensify/App/issues/<issueID>
$ https://github.com/Expensify/App/issues/<issueID(comment)>

Do NOT only link the issue number like this: $ #<issueID>
--->
$ https://github.com/Expensify/App/issues/97875
PROPOSAL: https://github.com/Expensify/App/issues/97875#issuecomment-5192508025


<!--- 
If you want to trigger adhoc build of hybrid app from specific Mobile-Expensify PR please link it like this:

MOBILE-EXPENSIFY: https://github.com/Expensify/Mobile-Expensify/pull/<PR-number>

--->

### Tests
<!---
Add a numbered list of manual tests you performed that validates your changes work on all platforms, and that there are no regressions present.
Add any additional test steps if test steps are unique to a particular platform.
Manual test steps should be written so that your reviewer can repeat and verify one or more expected outcomes in the development environment.

For example:
1. Click on the text input to bring it into focus
2. Upload an image via copy paste
3. Verify a modal appears displaying a preview of that image
--->


1. Open App
2. Login with new gmail account
3. Create new workspace
4. Go to Workspace settings > Workflows
5. Enable Submissions
6. Set Submission frequency to Monthly
7. Select any day of the month (1 - 31)
8. Go to Workspace and create expense (no submit)
9. Check submission date in Next Step banner
10. Verify that monthly submission date in Next Step banner should match the date specified in the workspace settings.
11. 

- [ ] Verify that no errors appear in the JS console

### Offline tests
<!---
Add any relevant steps that validate your changes work as expected in a variety of network states e.g. "offline", "spotty connection", "slow internet", etc. Manual test steps should be written so that your reviewer and QA testers can repeat and verify one or more expected outcomes. If you are unsure how the behavior should work ask for advice in the `#expensify-open-source` Slack channel.
--->

### QA Steps
<!---
Add a numbered list of manual tests that can be performed by our QA engineers on the staging environment to validate that your changes work on all platforms, and that there are no regressions present.
Add any additional QA steps if test steps are unique to a particular platform.
Manual test steps should be written so that the QA engineer can repeat and verify one or more expected outcomes in the staging environment.

For example:
1. Click on the text input to bring it into focus
2. Upload an image via copy paste
3. Verify a modal appears displaying a preview of that image

It's acceptable to write "Same as tests" if the QA team is able to run the tests in the above "Tests" section.
--->
// TODO: These must be filled out, or the issue title must include "[No QA]."

- [ ] Verify that no errors appear in the JS console

### PR Author Checklist
<!--
This is a checklist for PR authors. Please make sure to complete all tasks and check them off once you do, or else your PR will not be merged!
-->

- [x] I linked the correct issue in the `### Fixed Issues` section above
- [x] I wrote clear testing steps that cover the changes made in this PR
    - [x] I added steps for local testing in the `Tests` section
    - [x] I added steps for the expected offline behavior in the `Offline steps` section
    - [x] I added steps for Staging and/or Production testing in the `QA steps` section
    - [x] I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    - [x] 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)
    - [x] I tested this PR with a [High Traffic account](https://github.com/Expensify/App/blob/main/contributingGuides/CONTRIBUTING.md#high-traffic-accounts) against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
- [x] I included screenshots or videos for tests on [all platforms](https://github.com/Expensify/App/blob/main/contributingGuides/CONTRIBUTING.md#make-sure-you-can-test-on-all-platforms)
- [x] I ran the tests on **all platforms** & verified they passed on:
    - [x] Android: Native
    - [x] Android: mWeb Chrome
    - [x]  iOS: Native
    - [x] iOS: mWeb Safari
    - [x] MacOS: Chrome / Safari
- [x] 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)
- [x] I followed proper code patterns (see [Reviewing the code](https://github.com/Expensify/App/blob/main/contributingGuides/PR_REVIEW_GUIDELINES.md#reviewing-the-code))
    - [x] I verified that comments were added to code that is not self explanatory
    - [x] 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.
    - [x] 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)
- [x] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
- [x] I followed the guidelines as stated in the [Review Guidelines](https://github.com/Expensify/App/blob/main/contributingGuides/PR_REVIEW_GUIDELINES.md)
- [x] 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)
- [x] If a new CSS style is added I verified that:
    - [x] A similar style doesn't already exist
    - [x] The style can't be created with an existing [StyleUtils](https://github.com/Expensify/App/blob/main/src/styles/utils/index.ts) function (i.e. `StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)`)
- [x] If new assets were added or existing ones were modified, I verified that:
    - [x] The assets are optimized and compressed (for SVG files, run `npm run compress-svg`)
    - [x] The assets load correctly across all supported platforms.
- [x] 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.
- [x] 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)
- [x] 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.
- [x] 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.
- [x] 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:
    - [x] I verified that all the inputs inside a form are aligned with each other.
    - [x] I added `Design` label and/or tagged `@Expensify/design` so the design team can review the changes.
- [x] I added [unit tests](https://github.com/Expensify/App/blob/main/tests/README.md) for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
- [x] 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
<details>
<summary>Android: Native</summary>

<!-- add screenshots or videos here -->

</details>

<details>
<summary>Android: mWeb Chrome</summary>

<!-- add screenshots or videos here -->

</details>

<details>
<summary>iOS: Native</summary>

<!-- add screenshots or videos here -->

</details>

<details>
<summary>iOS: mWeb Safari</summary>

<!-- add screenshots or videos here -->

</details>

<details>
<summary>MacOS: Chrome / Safari</summary>

<!-- add screenshots or videos here -->

</details>

@ZhenjaHorbach

ZhenjaHorbach commented Aug 14, 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 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
    • 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
    • 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 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
2026-08-14.11.53.40.mov
Android: mWeb Chrome
2026-08-14.11.45.51.mov
iOS: HybridApp
2026-08-14.11.51.28.mov
iOS: mWeb Safari
2026-08-14.11.45.51.mov
MacOS: Chrome / Safari
2026-08-14.11.44.28.mov

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 Done — I updated the PR description with the content you provided.

I also verified the fix on Android (standalone NewDot): set Workspace Settings → Workflows → Frequency: Monthly, Date of month: 15th, created an unsubmitted expense, and the Next Step banner read "Waiting for your expenses to automatically submit on the 15th of each month." The banner day (15th) matches the configured day — no off-by-one. ✅

Workflows settings — Frequency Monthly, Date of month 15th

Workflows settings showing Delay submissions on, Frequency Monthly, Date of month 15th

Next Step banner — submits on the 15th

Expense report Next Step banner: Waiting for your expenses to automatically submit on the 15th of each month.

@iwiznia
iwiznia removed the request for review from neil-marcellini August 18, 2026 16:39
@iwiznia
iwiznia merged commit b53605c into main Aug 18, 2026
36 of 41 checks passed
@iwiznia
iwiznia deleted the claude-monthlyNextStepDateOffByOne branch August 18, 2026 16:39
@OSBotify

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.

@github-actions

Copy link
Copy Markdown
Contributor

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

@OSBotify OSBotify mentioned this pull request Aug 18, 2026
66 tasks done
@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/iwiznia in version: 9.4.56-0 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor Author

🤖 No help site changes required — I did not create a draft docs PR.

Why: This PR is a purely internal bug fix in the Next Step banner render path. It changes how a date-only string is parsed (new Date(...) → date-fns parseISO) so the monthly automatic-submit date renders on the day configured in Workflows, instead of one day earlier in UTC-negative timezones. There is no new feature, no UI/label change, and no change to documented behavior — the fix makes the app correctly match what the help site already describes (reports submit on the day you set).

I reviewed the naming conventions, authoring guidelines, and template, then searched App/docs/articles for the relevant surfaces (Next Step, automatic submissions, submission frequency, Workflows). The only article covering this area — How to set up automatic employee report submissions — documents configuration behavior and does not describe the Next Step banner's date rendering, so there is nothing to correct or add for this change.

@ZhenjaHorbach, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR Ready for review.

Note: since no docs update is needed, no help site PR was created — there's nothing to mark ready for review. If you'd still like a documentation addition here (e.g. clarifying the automatic-submission schedule in the help article), let me know and I'll draft one.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/Beamanator in version: 9.4.56-3 🚀

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

Bundle Size Analysis (Sentry):

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.

4 participants