Repository navigation
Fix monthly Next Step submit date shifting one day back in UTC-negative timezones - #98132
Conversation
…ve timezones Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>
|
@MelvinBot |
|
🤖 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 The only two failing checks are process gates that require human action, not a code push:
Both clear on their own once the checklist is completed and the PR gets its independent approval, so I'm not pushing any changes. |
|
🤖 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:
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>
|
Added cross-timezone tests for the monthly Next Step submit date in Why it runs date parsing in a child process: the natural approach — set Verification & known limitation
|
|
@MelvinBot |
Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>
|
🤖 Fixed the failing The new cross-timezone test commit added The remaining |
|
Spellcheck is now passing ✅ The failure was cspell flagging the IANA timezone name Verified locally ( |
|
🤖 Checked again — nothing changed and there is nothing for me to push. Every code/test check is green (typecheck, ESLint, Bun tests, all 8 The only two failing checks are process gates that I cannot resolve with a code change, and re-running me won't clear them:
Once those two human steps are done, both checks turn green. There's no code fix outstanding on this PR. |
|
🤖 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:
Both clear once the checklist is completed and the PR gets its independent approval. |
|
@MelvinBot |
Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>
|
Done — dropped |
|
🤖 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 The only two failing checks are process gates that require human action, not a code push:
Both clear on their own once the checklist is completed and the PR gets its independent approval, so I'm not pushing any changes. |
|
🤖 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:
There's nothing for me to push. Both clear on their own once the checklist is completed and the PR gets its independent approval. |
|
@MelvinBot |
…pDateOffByOne Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com> # Conflicts: # src/libs/NextStepUtils.ts
|
🤖 Merged Where it conflicted:
Resolution: combined both — kept eta = format(parseISO(nextStep.eta.dateTime), formatString, {locale: dateFnsLocale});
|
|
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. |
|
@MelvinBot |
…in merge Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>
|
@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] |
|
🤖 Fixed the failing checks and marked the PR ready for review. Root cause: The
Fix: Inserted const message = buildNextStepMessage(nextStep, translateEta, undefined, 999999, formatPhoneNumber);The remaining |
|
@MelvinBot |
| 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 |
There was a problem hiding this comment.
❌ 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.
There was a problem hiding this comment.
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..."
| 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 |
There was a problem hiding this comment.
❌ 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.
There was a problem hiding this comment.
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'..."
|
🤖 I can't complete the author checklist for you — most of it is a human attestation I'm not able to make truthfully. The
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 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 |
|
@MelvinBot |
Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>
|
🤖 Addressed both CONSISTENCY-16 review comments in 994bc25 — split the two em-dash comments in |
|
@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] |
|
@MelvinBot |
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp2026-08-14.11.53.40.movAndroid: mWeb Chrome2026-08-14.11.45.51.moviOS: HybridApp2026-08-14.11.51.28.moviOS: mWeb Safari2026-08-14.11.45.51.movMacOS: Chrome / Safari2026-08-14.11.44.28.mov |
|
🤖 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 15thNext Step banner — submits on the 15th |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 iwiznia has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/iwiznia in version: 9.4.56-0 🚀
|
|
🤖 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 ( I reviewed the naming conventions, authoring guidelines, and template, then searched @ZhenjaHorbach, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR 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. |
|
🚀 Deployed to production by https://github.com/Beamanator in version: 9.4.56-3 🚀
Bundle Size Analysis (Sentry): |


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) inbuildOptimisticNextStep. The bug was purely in the render path inbuildNextStepMessage: it re-parsed that date-only string with nativenew Date('2026-08-15'), which the ECMAScript spec parses as UTC midnight.date-fnsformat()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-fnsparseISO, which parses it as local midnight (same pattern already used inDistanceRequestUtils), 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
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari