Skip to content

Fix personal card From the beginning start date - #106772

Merged
luacmartins merged 3 commits into
mainfrom
claude-personalCardStartDate
Nov 16, 2026
Merged

luacmartins merged 3 commits into
mainfrom
claude-personalCardStartDate

Conversation

@MelvinBot

@MelvinBot MelvinBot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

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

  1. Sign in on App.
  2. Go to Account → Wallet → Personal card.
  3. Add a personal card with Mock Bank if you do not already have one, then open the card.
  4. Tap Transaction start date, select From the beginning, and tap Save.
  5. Verify the Transaction start date row on the card is blank.
  6. Open Transaction start date again and verify From the beginning is still selected. Tap Save without changing anything and verify the row stays blank.
  7. Open Transaction start date, select Custom start date, pick a date, and tap Save. Verify the row shows that date.
  8. Open Transaction start date again, select From the beginning, and tap Save. Verify the row is blank again.
  9. Turn the network off. Set a custom date, then switch it back to From the beginning and save. Verify the row becomes blank while offline. Turn the network back on and verify the row stays blank.
  • Verify that no errors appear in the JS console

Offline tests

N/A

QA Steps

  1. Sign in on App.
  2. Go to Account → Wallet → Personal card.
  3. Add a personal card with Mock Bank if you do not already have one, then open the card.
  4. Tap Transaction start date, select From the beginning, and tap Save.
  5. Verify the Transaction start date row on the card is blank.
  6. Open Transaction start date again and verify From the beginning is still selected. Tap Save without changing anything and verify the row stays blank.
  7. Open Transaction start date, select Custom start date, pick a date, and tap Save. Verify the row shows that date.
  8. Open Transaction start date again, select From the beginning, and tap Save. Verify the row is blank again.
  9. Turn the network off. Set a custom date, then switch it back to From the beginning and save. Verify the row becomes blank while offline. Turn the network back on and verify the row stays blank.
  • Verify that no errors appear in the JS console

AI Tests

Personal-card rollback follow-up (2026-11-15):

  • Reproduced failed rollback of an absent previous start date with a failing action test, then changed the failure merge to use oldStartDate ?? null, matching company-card behavior.
  • All 14 targeted tests passed across personal-card action, company-card action, and date-editor component suites. New coverage exercises optimistic state, rollback of absent/empty/custom dates, pending/error feedback, and successful saves using actual Onyx merges.
  • Full lint, typecheck, Storybook smoke test, whitespace check, and coding-standards review passed. The commit hook formats changed files with oxfmt.
  • Full Jest rerun exceeded the ten-minute limit without reaching a final result. Changed-file lint/spelling cannot find a merge base in this shallow checkout; changed-file compiler check timed out. The prescribed Prettier script is absent. These checks remain incomplete; earlier full-suite results below are historical.
  • This follow-up changes action rollback only; no new interactive browser verification was performed.

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, fetch claude-personalCardStartDate from upstream and push it to your fork.

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 verified any copy / text that was added to the app 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 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 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.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • 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

Card setup was blocked before transaction-start-date verification:

Browser error after proceeding with Mock Bank

Co-authored-by: Manan <mananjadhav@users.noreply.github.com>
@MelvinBot

MelvinBot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Web test steps verification results: ⚠️ partial

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.

Regions bank connection requires Online ID and password

Step Status
1. Signed-in NewDot is accessibleHome and authenticated Profile rendered without signing in again.
✅
2. Navigate Account → Wallet → Personal cardOpened Wallet and Add personal card; bank selection rendered.
✅
3. Add a personal cardRegions required Online ID and password. No credentials were supplied. Mock Bank was not retried following the previously reported connection failure.
Regions bank connection requires Online ID and password
❌
4. Open card and Transaction start dateBlocked: no connected personal card.
❌
5. Select From the beginning and saveBlocked: no connected personal card.
❌
6. Verify transaction start date row is blankNot reached; the fix remains unverified.
❌
7. Verify no JavaScript console errorsNot verified: console inspection is unavailable through the supported testing interface.
❌
8. Verify From the beginning persists after reopening and unchanged saveBlocked: no connected personal card.
❌
9. Verify custom date persists and can be clearedBlocked: no connected personal card.
❌

view run · no recording available

@MelvinBot

MelvinBot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Android test steps verification results: ⚠️ partial

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.

Blank start-date row after reopening and saving unchanged

Step Status
1. Access signed-in NewDotRecovered signed-in access and completed onboarding.
✅
2. Account → Wallet → Personal cardNavigated to Add personal card.
✅
3. Add personal cardMock Bank connection succeeded; opened Mock Credit Card ending 1234.
Connected Mock Credit Card with blank transaction start date
✅
4. Open card and Transaction start dateOpened the editor with an existing custom date.
✅
5. Select From the beginning and saveConfirmed the option was checked; Save returned to card details.
✅
6. Verify start-date row is blankRead-back confirmed Transaction start date had no accompanying date.
Connected Mock Credit Card with blank transaction start date
✅
7. Verify no JavaScript console errorsDiagnostic output could not be inspected; absence of errors is not established.
⚠️
8. Verify selection persists and unchanged save preserves itReopening showed From the beginning selected. Saving unchanged retained the blank row.
Blank start-date row after reopening and saving unchanged
✅
9. Verify custom date persists and can be clearedNot completed within the testing limit. Clearing an existing custom date passed, but saving and reopening a new custom date remain unverified.
⚠️

view run · view recording

@mananjadhav

Copy link
Copy Markdown
Collaborator

@MelvinBot Mark it ready for review.

@MelvinBot
MelvinBot marked this pull request as ready for review November 15, 2026 22:08
@MelvinBot
MelvinBot requested a review from a team as a code owner November 15, 2026 22:08
@MelvinBot

Copy link
Copy Markdown
Contributor Author

Marked this PR ready for review.


view run

@expensify-chore-bot
expensify-chore-bot Bot requested review from joekaufmanexpensify and removed request for a team November 15, 2026 22:08
@expensify-chore-bot

Copy link
Copy Markdown

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

@expensify-chore-bot
expensify-chore-bot Bot removed the request for review from a team November 15, 2026 22:08
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T22:11:50.863135Z 273b44a Draft marked ready
ℹ️ 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" or "@codex security review".

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>(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@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.

@MelvinBot MelvinBot Nov 15, 2026 •

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.

🤖 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.

Blank app page blocking personal-card verification

Step Status
Saved custom date displays and unchanged Save preserves itBrowser verification blocked: app snapshots returned zero nodes.
Blank app page blocking personal-card verification
❌
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);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@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.

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.

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.


view run

Co-authored-by: Manan <mananjadhav@users.noreply.github.com>
@MelvinBot
MelvinBot requested a review from a team as a code owner November 15, 2026 22:54
@expensify-chore-bot
expensify-chore-bot Bot requested review from mananjadhav and removed request for a team November 15, 2026 22:54
@expensify-chore-bot

Copy link
Copy Markdown

@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

codecov Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/libs/actions/Card.ts 26.19% <100.00%> (+1.90%) ⬆️
...allet/PersonalCardEditTransactionStartDatePage.tsx 92.75% <83.33%> (+92.75%) ⬆️
... and 427 files with indirect coverage changes

Co-authored-by: Manan <mananjadhav@users.noreply.github.com>
@mananjadhav

Copy link
Copy Markdown
Collaborator

QA Steps

  1. Sign in on App.
  2. Go to Account → Wallet → Personal card.
  3. Add a personal card with Mock Bank if you do not already have one, then open the card.
  4. Tap Transaction start date, select From the beginning, and tap Save.
  5. Verify the Transaction start date row on the card is blank.
  6. Open Transaction start date again and verify From the beginning is still selected. Tap Save without changing anything and verify the row stays blank.
  7. Open Transaction start date, select Custom start date, pick a date, and tap Save. Verify the row shows that date.
  8. Open Transaction start date again, select From the beginning, and tap Save. Verify the row is blank again.
  9. Turn the network off. Set a custom date, then switch it back to From the beginning and save. Verify the row becomes blank while offline. Turn the network back on and verify the row stays blank.

@mananjadhav

Copy link
Copy Markdown
Collaborator

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 any copy / text that was added to the app 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 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 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.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • 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
android-personal-card-transaction-date.mov
Android: mWeb Chrome
mweb-chrome-personal-card-transaction-date.mov
iOS: HybridApp
ios-personal-card-transaction-date.mov
iOS: mWeb Safari
mweb-safari-personal-card-transaction-date.mov
MacOS: Chrome / Safari
web-personal-card-transaction-date.mov

@melvin-bot

melvin-bot Bot commented Nov 16, 2026

Copy link
Copy Markdown

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!

@mananjadhav

Copy link
Copy Markdown
Collaborator

@luacmartins @joekaufmanexpensify Can one of you post the QA steps in the PR body

@luacmartins

Copy link
Copy Markdown
Contributor

Done

@luacmartins
luacmartins merged commit b60dd88 into main Nov 16, 2026
49 of 52 checks passed
@luacmartins
luacmartins deleted the claude-personalCardStartDate branch November 16, 2026 18:08
@github-actions

Copy link
Copy Markdown
Contributor

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

@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

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/luacmartins in version: 9.5.40-0 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor Author

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.


view run

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/marcaaron in version: 9.5.40-1 🚀

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

Melvin-Test-Android Melvin-Test-Web Triggers Melvin to run the testing steps of the PR on web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants