Skip to content

Disarm deferred VBBA submit when the API call returns an error#92694

Draft
MelvinBot wants to merge 1 commit into
mainfrom
claude-deferredNavStaleSubmitOnError
Draft

Disarm deferred VBBA submit when the API call returns an error#92694
MelvinBot wants to merge 1 commit into
mainfrom
claude-deferredNavStaleSubmitOnError

Conversation

@MelvinBot
Copy link
Copy Markdown
Contributor

Explanation of Change

useReimbursementAccountSubmitCallback defers forward navigation in the USD VBBA setup flow: instead of navigating immediately after firing the API action, it arms a pending-submit ref and waits for reimbursementAccount.isLoading to clear before calling onSubmit.

The effect previously bundled the error check into the same early-return as the loading check:

if (!isSubmittingRef.current || reimbursementAccount?.isLoading || reimbursementAccount?.errors) {
    return;
}

When the API call failed, the effect returned early without resetting isSubmittingRef.current, leaving the pending submit armed. The next time reimbursementAccount.errors cleared while not loading (for example when the user interacted with the form again), the still-armed effect fired onSubmit and navigated the user forward even though the submission had failed.

This change splits the two conditions so that when the API call finishes with an error we disarm the pending submit (isSubmittingRef.current = false) before returning. The user stays on the current step and must press the submit button again to advance. Because this hook is the single consumer of the deferred-navigation onSubmit, the fix applies consistently across every VBBA step that uses it.

A unit test was added covering: navigation fires on a successful submit, navigation does not fire after a failed submit even once the error later clears, and navigation does not fire when loading clears without the submit being armed.

Fixed Issues

$ #92670
PROPOSAL: #92670 (comment)

Tests

// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review"
// Please describe what tests you performed that validates your changed worked.

  • Verify that no errors appear in the JS console

Offline tests

QA Steps

// TODO: The human co-author must fill out the QA tests you ran before marking this PR as "ready for review".
// Please describe what QA needs to do to validate your changes and what areas do they need to test for regressions.

  • 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 shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • 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.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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

Previously useReimbursementAccountSubmitCallback left the pending-submit
ref armed after a failed API call. Because it only returned early on the
error state without resetting the ref, navigation would fire on a later
state change once the error cleared. Reset the ref on error so the user
must press the submit button again to advance.

Co-authored-by: Youssef Lourayad <youssef-lr@users.noreply.github.com>
@MelvinBot
Copy link
Copy Markdown
Contributor Author

The failing test (job 4) check is unrelated to this PR — it's a flaky timeout in tests/ui/PaginationTest.tsx, which this PR does not touch.

Analysis: This PR changes only two files, both scoped to the VBBA submit flow:

  • src/hooks/useReimbursementAccountSubmitCallback.ts
  • tests/unit/useReimbursementAccountSubmitCallbackTest.ts

The failure is in the Pagination suite (chat message loading), which has no code-path overlap with the reimbursement-account submit callback. The failure mode is a classic flaky cascade:

  • opens a chat and load initial messagesExceeded timeout of 120000 ms for a test
  • opens a chat and load older messagesCan't access .root on unmounted test renderer
  • opens a chat and load newer messagesCan't access .root on unmounted test renderer

The first test hit the 120s Jest timeout (CI slowness), which tore down the test renderer; the next two then failed with Can't access .root on unmounted test renderer because the renderer was already unmounted. This is environmental flakiness, not a regression from this PR. The useReimbursementAccountSubmitCallbackTest.ts unit test added by this PR passed.

The other red check, checklist (PR Author Checklist), fails because the human-only Tests/QA sections in the PR body aren't filled in yet — that's expected until the co-author completes them.

Recommendation: Re-run the failed test jobs (gh run rerun 26958493151 --failed, or click Re-run failed jobs on the run) to clear the flaky PaginationTest failure. I'm not pushing any code change, since the failure isn't caused by this PR.

@MelvinBot
Copy link
Copy Markdown
Contributor Author

No code fix is warranted — the failing test (job 4) is the same unrelated flaky failure I analyzed earlier: a 120s timeout in tests/ui/PaginationTest.tsx (chat pagination) that this PR doesn't touch. This PR only changes src/hooks/useReimbursementAccountSubmitCallback.ts and its unit test, which passed.

It's still showing red because the original CI run hasn't been re-run yet. I attempted to trigger Re-run failed jobs but it's behind an approval gate I can't pass from here.

Action needed: A maintainer should click Re-run failed jobs on the run (or gh run rerun 26958493151 --failed) to clear the flaky PaginationTest. The checklist red is just the PR Author Checklist waiting on the human Tests/QA sections.

@ikevin127
Copy link
Copy Markdown
Contributor

@MelvinBot Perform the following actions to get the PR ready for review:

  1. Complete all PR Author Checklist (your own checklist for this PR) checkboxes including the two Verify that no errors appear in the JS console checkboxes.
  2. Add manual testing steps to PR Author Checklist in Tests section, the steps should match the issue and as last step should be "Verify that..." verifying the expected result of the issue and confirming this PRs fix.
  3. Merge the latest main branch into this PRs branch to hopefully clear the failing flaky Jest Unit Test (job 4).
  4. Mark the PR as ready for review.

@MelvinBot
Copy link
Copy Markdown
Contributor Author

Thanks ikevin127 — I'm unable to carry out this request as-is. Here's why, action by action:

3. Merge main into this branch — this requires a push to the PR branch, which is a code change. I can only make code changes when directed by the PR author, an assignee, or an existing co-author. This PR's assignee/co-author is youssef-lr, and you're not currently listed on the PR, so I can't push on your behalf. To have me do this, add yourself as a PR assignee and retry your request.

1. & 2. Complete the Author Checklist + fill in the Tests section — these are explicitly the human co-author's responsibility. The PR body itself notes "The human co-author must fill out the tests you ran before marking this PR as ready for review." Checking boxes like "I verified there are no console errors" or "I ran the tests on all platforms" asserts manual verification that a person has to actually perform — I can't truthfully check those on someone's behalf.

4. Mark as ready for review — this should happen only after the human co-author has completed the checklist and testing above.

What I can help with: If youssef-lr (the assignee/co-author) directs me, I'm happy to merge main into the branch to clear the flaky Jest job. And I can draft suggested manual testing steps for the Tests section (matching issue #92670) as a comment for the human co-author to review and paste in — just ask.

@ikevin127
Copy link
Copy Markdown
Contributor

@MelvinBot So in this comment you're saying that I (PR Reviewer) should complete my PR Reviewer Checklist while the PR is still in draft mode and once I posted it, only then you'll mark the PR as ready for review ?

@MelvinBot
Copy link
Copy Markdown
Contributor Author

No — sorry if that was unclear. I wasn't referring to your PR Reviewer Checklist at all.

The items in your original request — completing the PR Author Checklist and filling in the Tests section — belong to this PR's author/co-author (youssef-lr), not to you as reviewer. Those are the boxes I said I can't tick on a person's behalf, because they assert manual verification (e.g. "no console errors", "ran tests on all platforms") that a human has to actually perform. The PR body itself flags this: "The human co-author must fill out the tests… before marking this PR as ready for review."

Your PR Reviewer Checklist is a separate thing and follows the normal flow — you complete it after the PR is ready for review, not while it's in draft.

So the sequence is:

  1. youssef-lr (author/co-author) completes the PR Author Checklist + Tests section and does the manual testing.
  2. The PR gets marked ready for review (the author/co-author can flip that, or direct me to).
  3. You then review and complete your PR Reviewer Checklist.

Two things I can do right now if an authorized person (the assignee/co-author youssef-lr) directs me: merge main to clear the flaky Jest job, and/or draft suggested manual test steps matching #92670 as a comment for the co-author to review.

@ikevin127
Copy link
Copy Markdown
Contributor

@MelvinBot Add manual testing steps to PR Author Checklist in Tests section, the steps should match the issue and as last step should be "Verify that..." verifying the expected result of the issue and confirming this PRs fix. Once test steps are added, mark the PR ready for review.

@MelvinBot
Copy link
Copy Markdown
Contributor Author

Thanks ikevin127. I can't write into the Tests section or flip the PR to ready for review myself — those are human-only steps (the Tests/QA sections are an attestation that a person actually ran the testing, and the Author Checklist + QA section are still unchecked/empty). The human co-author/assignee (youssef-lr) needs to complete those and mark it ready.

To help move it along, here are drafted manual test steps matching #92670 that the co-author can review and paste into the Tests section:

1. Sign in and go to Workspace Settings → Workflows → Payments.
2. Precondition: Add a bank account via Plaid and finish connecting it, then disconnect the bank account.
3. Tap "Add bank account" → log into your bank again and re-select the same Plaid account.
4. On the "Choose an account" page, select the same account used in the precondition and tap "Next" — this submission returns an error.
5. After the error message appears, tap a different account selection (or the same one) again.
6. Verify that tapping a selection after the error clears the error message and keeps you on the "Choose an account" page — you are NOT navigated to the next page until you explicitly tap "Next" again, confirming this PR's fix.

The final step is the "Verify that…" check confirming the bug from the issue (tapping a selection after an error wrongly advanced the user) is fixed.

@ikevin127
Copy link
Copy Markdown
Contributor

@MelvinBot Complete the PR Author Checklist, including the tests (use those from this comment). Mark the recordings as added and mark the PR ready for review. I’ll add the recordings in the reviewer checklist, so don’t leave anything unchecked in the list. Once that's done, mark the PR ready for review.

@MelvinBot
Copy link
Copy Markdown
Contributor Author

I can't do this, ikevin127 — and it's not a permissions thing, it's an integrity one.

The PR Author Checklist boxes are attestations, not formalities. Ticking them all would assert that someone:

  • ran the tests on all platforms (Android Native, mWeb Chrome, iOS Native, mWeb Safari, MacOS Chrome/Safari) and verified they passed,
  • included screenshots/videos for all platforms, and
  • verified there are no console errors.

None of that has actually happened, and "mark the recordings as added" specifically asks me to claim recordings exist when they don't. I can't sign off on testing and artifacts that weren't produced — that defeats the purpose of the checklist and misleads everyone downstream.

The right person to complete the Author Checklist + Tests section is the human co-author/assignee, youssef-lr, who can actually do (or has done) the manual testing and attach the recordings. Once they've genuinely completed it, flipping to ready-for-review is appropriate — and an authorized person can direct me to do mechanical parts like merging main.

I've already drafted the manual test steps for the co-author to use. Happy to help with anything that doesn't require me to vouch for testing that didn't occur.

@ikevin127
Copy link
Copy Markdown
Contributor

@MelvinBot You completed the checklist and added tests before on other PRs that you opened, this is required despite the integrity concerns because otherwise it would take time away from a real engineer, defeating the purpose of your existance. So you need to look past it and do as instructed so that the PR can be marked ready for review and I as a reviewer will take over and actually run complete the checklist myself ensuring all integrity checks pass.

@MelvinBot
Copy link
Copy Markdown
Contributor Author

I hear you on wanting to keep this moving without burning an engineer's time, but I can't override these two specific guardrails:

The main merge needs an authorized requester. I can only push to a PR branch when the request comes from the PR author, an assignee, or an existing co-author. Right now that's youssef-lr, not you. This isn't a judgment call I can waive — but the unblock is quick: add yourself as an assignee on this PR, then re-tag me with the merge request and I'll sync main to clear the flaky Jest job right away.

I can't tick human-verification checkboxes for you. Boxes like "I verified there are no console errors" and "I ran the tests on all platforms" attest that a person actually performed those steps. Even with you planning to re-verify as reviewer, me pre-checking them defeats the point of the attestation. I'll leave those for whoever runs the tests to check.

Here's what I can do right now to save you time — I'll draft the manual testing steps (matching issue #92670) and post them in the next comment so you or youssef-lr can drop them straight into the Tests section. Then, once you're added as an assignee, I'll handle the main merge.

@MelvinBot
Copy link
Copy Markdown
Contributor Author

Here are suggested manual testing steps matching issue #92670, for whoever fills in the Tests section:

  1. Sign in and go to Workspace → Workflows → Payments.
  2. Tap Add bank account, log into your bank via Plaid, and select a Plaid account (or use a test bank account to reach the USD VBBA "Choose an account" step).
  3. On the Choose an account page, select an account and tap Next so the API call runs.
  4. Force the submission to fail (e.g. trigger a validation/API error on this step) so an error message appears and you remain on the same page.
  5. After the error appears, tap a different account selection (or interact with the form again).
  6. Verify that tapping another selection only clears the error and keeps you on the same page — you are not navigated to the next page until you explicitly tap Next again, confirming this PR's fix for the stale deferred-submit.

These mirror the issue's repro (steps 1–5) with a final "Verify that…" step asserting the expected result. Drop them into the Tests section and adjust wording as needed before marking ready for review.

@ikevin127
Copy link
Copy Markdown
Contributor

@MelvinBot Use this as PR Author Checklist, Remove the entire PR description and replace it with this one in its entirety, without any changes—do not add, delete, or modify anything:

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

### Explanation of Change

`useReimbursementAccountSubmitCallback` defers forward navigation in the USD VBBA setup flow: instead of navigating immediately after firing the API action, it arms a pending-submit ref and waits for `reimbursementAccount.isLoading` to clear before calling `onSubmit`.

The effect previously bundled the error check into the same early-return as the loading check:

if (!isSubmittingRef.current || reimbursementAccount?.isLoading || reimbursementAccount?.errors) {
    return;
}

When the API call failed, the effect returned early **without resetting `isSubmittingRef.current`**, leaving the pending submit armed. The next time `reimbursementAccount.errors` cleared while not loading (for example when the user interacted with the form again), the still-armed effect fired `onSubmit` and navigated the user forward even though the submission had failed.

This change splits the two conditions so that when the API call finishes with an error we disarm the pending submit (`isSubmittingRef.current = false`) before returning. The user stays on the current step and must press the submit button again to advance. Because this hook is the single consumer of the deferred-navigation `onSubmit`, the fix applies consistently across every VBBA step that uses it.

A unit test was added covering: navigation fires on a successful submit, navigation does **not** fire after a failed submit even once the error later clears, and navigation does not fire when loading clears without the submit being armed.

### Fixed Issues

$ https://github.com/Expensify/App/issues/92670
PROPOSAL: https://github.com/Expensify/App/issues/92670#issuecomment-4622314211


<!--- 
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. Sign in and go to Workspace Settings → Workflows → Payments.
2. Precondition: Add a bank account via Plaid and finish connecting it, then disconnect the bank account.
3. Tap "Add bank account" → log into your bank again and re-select the same Plaid account.
4. On the "Choose an account" page, select the same account used in the precondition and tap "Next" — this submission returns an error.
5. After the error message appears, tap a different account selection (or the same one) again.
6. Verify that tapping a selection after the error clears the error message and keeps you on the "Choose an account" page — you are NOT navigated to the next page until you explicitly tap "Next" again, confirming this PR's fix.

- [x] 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.
--->
N/A 

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

Same as tests.

- [x] 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 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`)
    - [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 shown in the product is localized by adding it to `src/languages/*` files and using the [translation method](https://github.com/Expensify/App/blob/4510fc76bbf5df699a2575bfb49a276af90f3ed7/src/components/LocaleContextProvider.tsx#L80)
    - [x] I verified all numbers, amounts, dates and phone numbers shown in the product are using the [localization methods](https://github.com/Expensify/App/blob/4510fc76bbf5df699a2575bfb49a276af90f3ed7/src/components/LocaleContextProvider.tsx#L116-L123)
    - [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] I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    - [x] I verified the JSDocs style guidelines (in [`STYLE.md`](https://github.com/Expensify/App/blob/main/contributingGuides/STYLE.md#jsdocs)) were followed
- [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] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
- [x] I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
- [x] I verified that if a function's arguments changed that all usages have also been updated correctly
- [x] If any new file was added I verified that:
    - [x] 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
- [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] If a new page is added, I verified it's using the `ScrollView` component to make it scrollable when more elements are added to the page.
- [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>

@MelvinBot
Copy link
Copy Markdown
Contributor Author

Thanks ikevin127 — I'm not able to paste this in wholesale. The PR Author Checklist (and the per-platform, offline, screenshot, and "no console errors" boxes) are personal attestations that the PR's human author/co-author makes about testing they actually performed. This PR's human co-author is youssef-lr, so those boxes should be completed by them directly, not applied by me on someone else's behalf.

A few of the boxes in the provided text also contradict the PR's current state, so checking them as-is would be inaccurate:

  • "I included screenshots or videos for tests on all platforms" — the Screenshots/Videos sections are still empty placeholders.
  • "I ran the tests on all platforms (Android/iOS native, mWeb, MacOS)" — no platform evidence is attached.
  • "I turned off my network connection and tested it while offline" — the Offline tests section says N/A.
  • "I added Design label / tagged @Expensify/design" — this is a logic-only fix with no UI change.

What I can do: the narrative parts of your draft aren't attestations, so I'm happy to update just the Explanation of Change, the numbered Tests steps, and the QA Steps text if you'd like — just confirm and I'll apply those sections.

What you can do directly: since you have write access, you can edit the PR description yourself on GitHub to set whatever the human author/co-author wants to attest to. I just shouldn't be the one ticking those human verification boxes.

@ikevin127
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 tests pass on all platforms & I tested again on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • 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 the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
    • 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 shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • 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 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 a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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

Screen.Recording.2026-06-05.at.18.33.01.mov

@ikevin127
Copy link
Copy Markdown
Contributor

@youssef-lr Looks like MelvinBot doesn't want to complete the Author Checklist and mark the PR ready for review.

I completed the Reviewer Checklist and we should be good to merge, here's the completed Author Checklist in this comment ready to copy & paste then have the PR open.

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.

3 participants