Repository navigation
Fix personal card From the beginning start date - #106772
Conversation
Co-authored-by: Manan <mananjadhav@users.noreply.github.com>
|
🤖 Web test steps verification results: Verified signed-in dev NewDot web and reached personal-card setup. Other → Regions requires unavailable bank credentials, so no card was created and date behavior could not be verified.
view run · no recording available |
|
🤖 Android test steps verification results: Verified on standalone Android NewDot: Mock Bank connection succeeded, From the beginning saved as a blank start-date row, and reopening plus unchanged save preserved it. Console inspection and custom-date regression remain unverified.
|
|
@MelvinBot Mark it ready for review. |
|
Marked this PR ready for review. |
|
@mananjadhav 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] |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
| const currentStartDate = card?.scrapeMinDate; | ||
|
|
||
| const [dateOptionSelected, setDateOptionSelected] = useState<DateOption>(CONST.COMPANY_CARD.TRANSACTION_START_DATE_OPTIONS.CUSTOM); | ||
| const [dateOptionSelected, setDateOptionSelected] = useState<DateOption>( |
There was a problem hiding this comment.
@MelvinBot useState keeps the first currentStartDate, so a render before useOnyx has the card stays on "From the beginning" and Save writes '' over the custom date that arrives next.
There was a problem hiding this comment.
🤖 Web test steps verification results: ❌ fail
Confirmed and fixed the initialization bug: late-arriving card data now supplies the defaults without overwriting user edits, and Save is disabled without a card; all eight component tests, lint, typecheck, and Storybook smoke test passed. Web verification was blocked by a blank app and suspended session—not a confirmed product regression—and remaining check limitations are documented in AI Tests.
| Step | Status |
|---|---|
| ❌ | |
From the beginning clears the date and persists after reopeningNot verified: app session unavailable. |
❌ |
Opening before card data loads cannot overwrite a later-arriving custom dateBrowser reproduction blocked; the automated regression test reproduced the original failure and passes with the fix. |
❌ |
view run · no recording available
|
|
||
| if (currentStartDate !== newStartDate) { | ||
| if ((currentStartDate ?? '') !== newStartDate) { | ||
| updateAssignedCardTransactionStartDate(cardID, newStartDate, currentStartDate); |
There was a problem hiding this comment.
@MelvinBot scrapeMinDate: oldStartDate in updateAssignedCardTransactionStartDate (Card.ts:579) leaves the optimistic custom date in place when the previous date is missing; company cards use oldStartDate ?? null for this same command.
There was a problem hiding this comment.
Confirmed and fixed: rollback now uses oldStartDate ?? null, removing the optimistic date when no previous date exists while preserving empty/custom dates.
All 14 targeted tests, lint, typecheck, and Storybook smoke test passed. Full-suite and changed-file check limitations are documented in AI Tests.
Co-authored-by: Manan <mananjadhav@users.noreply.github.com>
|
@mananjadhav 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] |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Co-authored-by: Manan <mananjadhav@users.noreply.github.com>
QA Steps
|
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid-personal-card-transaction-date.movAndroid: mWeb Chromemweb-chrome-personal-card-transaction-date.moviOS: HybridAppios-personal-card-transaction-date.moviOS: mWeb Safarimweb-safari-personal-card-transaction-date.movMacOS: Chrome / Safariweb-personal-card-transaction-date.mov |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #105525 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
|
@luacmartins @joekaufmanexpensify Can one of you post the QA steps in the PR body |
|
Done |
|
🚧 luacmartins has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.5.40-0 🚀
|
|
No help site update needed — this PR fixes personal-card start-date saving to honor the existing selection as users would expect; it adds no new workflow and makes no existing article sentence incorrect. |
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.5.40-1 🚀
Bundle Size Analysis (Sentry): |




Explanation of Change
Save an empty start date for personal cards when selecting "From the beginning", matching the existing company-card flow instead of substituting a date 90 days ago. Initialize the selection from the saved date and avoid sending updates for unchanged empty dates. Add four regression cases for clearing a custom date and preserving existing selections.
Fixed Issues
$ #105525
PROPOSAL: #105525 (comment)
Tests
Offline tests
N/A
QA Steps
AI Tests
Personal-card rollback follow-up (2026-11-15):
oldStartDate ?? null, matching company-card behavior.Review follow-up (2026-11-15):
Reproduced the delayed-card initialization regression with a failing component test, then fixed it. All eight date-editor tests now pass, including late card arrival, blocked Save without a card, and preservation of explicit edits during card updates.
Full lint, typecheck, Storybook smoke test, and diff whitespace check passed. Coding-standards review found no violations.
Full Jest rerun exceeded the four-minute execution limit; the prior full-suite result below is historical, not verification of this follow-up.
Changed-file lint could not find a merge base in the shallow checkout; deepening history, compiler changed-file check, and changed-file spelling timed out. The prescribed Prettier script is absent; direct formatter and spelling commands were denied by execution permissions, but the pre-commit oxfmt hook subsequently formatted both files successfully. Full lint passed after correcting a React Compiler purity finding.
Web verification was blocked by a blank app and suspended browser session; date behavior could not be verified interactively.
Full Jest suite passed: 2,366 suites, 39,337 tests, and 160 snapshots; 146 tests and one suite skipped. Includes all four new regression cases.
Typecheck, full lint, initial changed-file lint, spelling for both changed files, and Storybook smoke test passed.
The modified page passed the direct React Compiler check. The changed-file compiler wrapper failed to resolve its base ref; a later changed-file lint rerun could not determine its merge base after fetching newer main history.
The prescribed Prettier script does not exist in this checkout; available formatter invocations were blocked by execution permissions. Formatting verification remains incomplete.
Browser verification was partial: signed-in NewDot and Wallet worked, but connecting Mock Bank reached a browser error, preventing card-date persistence verification. Backend history limits remain unconfirmed; verify before marking ready for review.
Coding-standards review found no violations.
Created from an upstream branch because Melvin cannot push to
mananjadhav's fork. To take ownership, fetchclaude-personalCardStartDatefrom upstream and push it to your fork.PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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
Card setup was blocked before transaction-start-date verification: