Skip to content

Fix approve button not shown because of invisible broken card connection violation#74738

Merged
cead22 merged 35 commits intoExpensify:mainfrom
rayane-d:fix-approve-button-not-shown-because-of-brokenCardConnection-violation
Nov 24, 2025
Merged

Fix approve button not shown because of invisible broken card connection violation#74738
cead22 merged 35 commits intoExpensify:mainfrom
rayane-d:fix-approve-button-not-shown-because-of-brokenCardConnection-violation

Conversation

@rayane-d
Copy link
Contributor

@rayane-d rayane-d commented Nov 10, 2025

Explanation of Change

Problem

When a submitter dismisses an RTER (broken card connection) violation on an expense report, the "Approve" button on the report preview doesn't appear for the approver, even though the approver should not see this violation at all.

Root Cause

The issue has two parts:

  1. Visibility Logic: TransactionUtils.shouldShowViolation() correctly hides RTER violations from approvers (non-submitters) on non-instant-submit policies:

if (violationName === CONST.VIOLATIONS.RTER) {
return (isSubmitter || isInstantSubmitEnabled(policy)) && (shouldShowRterForSettledReport || !isSettled(iouReport));
}

This means approvers should never see RTER violations on non instant-submit policies.

  1. Approve Action Availability Logic: ReportPreviewActionUtils.canApprove() was checking ReportUtils.hasAnyViolations() which:
    • Only filters violations dismissed by the current user (the approver)
    • Since the submitter dismissed it (not the approver), it is considered when determining if the Approve button should be displayed to the approver
    • Even though the violation is invisible to the approver, it still blocks the Approve button

const hasAnyViolations = hasMissingSmartscanFields(report.reportID, transactions) || hasAnyViolationsUtil(report.reportID, violations);

So the issue is that we were checking if violations exist, but not checking if those violations are visible to the current user.

Solution

This PR ensures that "Approve" action availability logic in ReportPreviewActionUtils.canApprove() only considers violations visible to the current user by properly integrating the dismissal and visibility logic.

1. Enhanced isViolationDismissed() to support all Auth dismissal rules

The function now implements the same three conditions as the Auth backend:

https://github.com/Expensify/Auth/blob/6005bc71c5ee81f4e89f9a70535d853b19eb57a5/auth/lib/Violations.cpp#L430-L451

The violation is considered dismissed if:

  • Current user dismissed it themselves
  • Admin viewing OPEN report AND report owner dismissed it
  • RTER violation on instant submit policy - dismissed by anyone

2. Fixed "Approve" action availability logic in ReportPreviewActionUtils.canApprove() to respect violation visibility

Updated to use hasVisibleViolationsForUser() which checks both:

  1. Is violation dismissed? (via isViolationDismissed)
  2. Should user see it? (via shouldShowViolation)

For the reported bug:

  1. Submitter dismisses RTER violation on non instant-submit policy
  2. Report is submitted
  3. Approver views the report
  4. shouldShowViolation() returns false because:
    • Approver is not submitter
    • Policy is not instant submit
  5. hasVisibleViolationsForUser() returns false (no visible violations)
  6. Approve button appears as expected

Before:

Screenshot 2025-11-11 at 2 47 35 PM

After:

Screenshot 2025-11-11 at 2 48 23 PM

3. Fixed empty "Next Step" message for dismissed violations

Problem:
When all violations were dismissed, the header tried to display a status message but useTransactionViolations filtered them out, resulting in an empty status bar.

Fix:
Added check to ensure violations exist before showing status:

if (!!transaction?.transactionID && !!transactionViolations.length && shouldShowBrokenConnectionViolation) {
    return {
        icon: getStatusIcon(Expensicons.Hourglass),
        description: <BrokenConnectionDescription ... />
    };
}

Before:

Screenshot 2025-11-11 at 2 45 28 PM

After:

Screenshot 2025-11-11 at 2 46 05 PM

4. Fixed "Mark as cash" primary action button on the report header instead of "Approve" button

Problem:

isMarkAsCashAction was using allHavePendingRTERViolation and shouldShowBrokenConnectionViolationForMultipleTransactions to display the "Mark as cash" button when it returns true. allHavePendingRTERViolation and shouldShowBrokenConnectionViolationForMultipleTransactions was considering all non-dismissed violations, it:

  • Only filters violations dismissed by the current user (the approver)
  • Since the submitter dismissed it (not the approver), it is considered when determining if the "isMarkAsCashAction" button should be displayed to the approver
  • Even though the violation is invisible to the approver, it still shows the "isMarkAsCashAction" button

const hasAllPendingRTERViolations = allHavePendingRTERViolation(reportTransactions, violations);

/**
* Check if there is pending rter violation in all transactionViolations with given transactionIDs.
*/
function allHavePendingRTERViolation(transactions: OnyxEntry<Transaction[] | SearchTransaction[]>, transactionViolations: OnyxCollection<TransactionViolations> | undefined): boolean {
if (!transactions) {
return false;
}
const transactionsWithRTERViolations = transactions.map((transaction) => {
const filteredTransactionViolations = getTransactionViolations(transaction, transactionViolations);
return hasPendingRTERViolation(filteredTransactionViolations);
});
return transactionsWithRTERViolations.length > 0 && transactionsWithRTERViolations.every((value) => value === true);
}

const shouldShowBrokenConnectionViolation = shouldShowBrokenConnectionViolationForMultipleTransactions(transactionIDs, report, policy, violations);

/**
* Check if user should see broken connection violation warning based on selected transactions.
*/
function shouldShowBrokenConnectionViolationForMultipleTransactions(
transactionIDs: string[],
// eslint-disable-next-line @typescript-eslint/no-deprecated
report: OnyxEntry<Report> | SearchReport,
policy: OnyxEntry<Policy>,
transactionViolations: OnyxCollection<TransactionViolation[]>,
): boolean {
const violations = transactionIDs.flatMap((id) => transactionViolations?.[`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${id}`] ?? []);
const brokenConnectionViolations = violations.filter((violation) => isBrokenConnectionViolation(violation));
return shouldShowBrokenConnectionViolationInternal(brokenConnectionViolations, report, policy);
}

Fix:

Updated allHavePendingRTERViolation() and shouldShowBrokenConnectionViolationForMultipleTransactions to check for both:

  1. Is violation dismissed? (via isViolationDismissed)
  2. Should user see it? (via shouldShowViolation)

Before:

Screenshot 2025-11-18 at 4 08 50 PM

After:

Screenshot 2025-11-18 at 4 06 24 PM

Fixed Issues

$ #73098
PROPOSAL:

Tests

  1. Download and import the onyx state from this comment: https://expensify.slack.com/archives/C05LX9D6E07/p1760755153206519?thread_ts=1760583420.629759&cid=C05LX9D6E07
  2. Run this in the browser console to add missing comment data to the transaction and to correct the violation name:
Onyx.merge('transactions_8142574694853799211', {
  "comment": {
    "attendees": [
      {
        "avatarUrl": "https://d1wpcgnaa73g0y.cloudfront.net/b99046a36bab1955c1669e891375a845d544a4fb_128.jpeg",
        "displayName": "Jasper Huang",
        "email": "jasper@expensify.com"
      }
    ],
    "comment": "***",
    "dismissedViolations": {
      "rter": {
        "jasper@expensify.com": 1760643377364493
      }
    }
  }
});
  
  
Onyx.set(`transactionViolations_8142574694853799211`, [{
      "data": {
          "rterType": "brokenCardConnection",
          "tooltip": "Personal Cards: Fix your card from Account Settings. Corporate Cards: ask your Expensify admin to fix your company's card connection."
      },
      "name": "rter",
      "showInReview": true,
      "type": "warning"
}]);
  1. Open the policy expense chat (report #96832091)
  2. Verify that the report preview action shows an "Approve" button
  3. Open the expense report (#1814181775632892)
  4. Verify that the primary action button is "Approve"
  5. Verify that there is no empty report next step message (there should be no next step for this one expense report)
  • Verify that no errors appear in the JS console

Offline tests

N/A

QA Steps

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

Same as tests

  • 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
    • MacOS: Desktop
  • 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 there are no new alerts related to the canBeMissing param for useOnyx
  • 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
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • 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
MacOS: Desktop

@codecov
Copy link

codecov bot commented Nov 11, 2025

Codecov Report

❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.

Files with missing lines Coverage Δ
...thSections/Search/TransactionGroupListExpanded.tsx 57.47% <100.00%> (ø)
src/hooks/useTransactionViolations.ts 100.00% <100.00%> (ø)
src/libs/ReportPrimaryActionUtils.ts 89.16% <100.00%> (-0.06%) ⬇️
src/libs/ReportSecondaryActionUtils.ts 90.93% <100.00%> (-0.03%) ⬇️
src/libs/ReportUtils.ts 74.21% <100.00%> (-0.03%) ⬇️
src/libs/SearchUIUtils.ts 69.22% <100.00%> (+0.03%) ⬆️
src/libs/TransactionPreviewUtils.ts 73.48% <100.00%> (+0.59%) ⬆️
src/libs/Violations/ViolationsUtils.ts 66.98% <100.00%> (ø)
...ionListWithSections/Search/TransactionListItem.tsx 2.12% <0.00%> (ø)
src/hooks/useTransactionsAndViolationsForReport.ts 68.75% <66.66%> (+4.46%) ⬆️
... and 5 more
... and 89 files with indirect coverage changes

return !!transaction?.comment?.dismissedViolations?.[violation.name];
}

return !!transaction?.comment?.dismissedViolations?.[violation.name]?.[currentUserEmail ?? deprecatedCurrentUserEmail];
Copy link
Contributor

Choose a reason for hiding this comment

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

the deprecatedCurrentUserEmail is not needed now?

lets add / update tests for this method

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the deprecatedCurrentUserEmail is not needed now?

It was added in #72940. Based on this comment, @DylanDylann might be working on a PR to remove it. @DylanDylann, can you please confirm?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah but if currentUserEmail is falsey we will never get there so we could remove it from this line now, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, I've removed it 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

currentUserEmail could still be undefined, so let's keep deprecatedCurrentUserEmail as a fallback for now. I'm still working on completely removing deprecatedCurrentUserEmail.

@rayane-d rayane-d requested a review from mountiny November 11, 2025 16:19
@rayane-d rayane-d marked this pull request as ready for review November 11, 2025 16:26
@rayane-d rayane-d requested review from a team as code owners November 11, 2025 16:26
@melvin-bot melvin-bot bot requested review from Krishna2323 and removed request for a team November 11, 2025 16:26
@melvin-bot
Copy link

melvin-bot bot commented Nov 11, 2025

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

@melvin-bot melvin-bot bot requested review from joekaufmanexpensify and removed request for a team November 11, 2025 16:26
mountiny
mountiny previously approved these changes Nov 11, 2025
Copy link
Contributor

@mountiny mountiny left a comment

Choose a reason for hiding this comment

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

Interesting, feels like this might have influenced many flows so I wonder if we are not missing anything about how violations are supposed to work, @pecanoro @cead22 do you think you could give this PR/ RCA a review too please?

@mountiny mountiny requested review from cead22 and pecanoro November 11, 2025 16:45
@cead22
Copy link
Contributor

cead22 commented Nov 11, 2025

This change ensures that violations dismissed by a user no longer incorrectly appear active for other users.

This isn't right for all cases. For instance for the duplicatedExpense violation if the submitter dismisses it, the approver should still see it, and vice versa. Let's make sure to test these two cases in this PR

This isViolationDismissed() is used to determine if we can display the approve button (this is the root cause of the reported bug) here:

This also doesn't sound right, as you should be able to submit reports with violations, unless you're on a domain group with Strictly enforce expense workspace rules enabled (only available in Classic)

image

As for the broken connection violation, search for dismissedByEmail in Auth's auth/lib/Violations.cpp so you can see the different conditions

…se for duplicatedExpense violation, if the submitter dismisses it, the approver should still see it, and vice versa
@rayane-d
Copy link
Contributor Author

rayane-d commented Nov 11, 2025

This change ensures that violations dismissed by a user no longer incorrectly appear active for other users.

This isn't right for all cases. For instance for the duplicatedExpense violation if the submitter dismisses it, the approver should still see it, and vice versa. Let's make sure to test these two cases in this PR

I checked all isViolationDismissed usages, and I believe the only concern we need to address is with the duplicatedExpense violation (great catch, @cead22!), specifically here:

const isDuplicatedTransactionViolationDismissed = isViolationDismissed(transaction, duplicatedTransactionViolation);

I've pushed a commit to handle this case: 4871b1f


In all the following isViolationDismissed usages, we pass the current user's email as a parameter:

!isViolationDismissed(transactionItem, violation, currentUserDetails.email ?? '') &&

!isViolationDismissed(transaction, violation, currentUserDetails.email ?? '') &&

return transactionViolations.filter((violation) => !isViolationDismissed(transaction, violation, currentUserEmail));

(violation) => !isViolationDismissed(transaction, violation, currentUserEmail),


In the following usages, we don't pass the email parameter, which is intentional because we want to check if the violation has been dismissed by any user:

!isViolationDismissed(transaction, violation),

!isViolationDismissed(transaction, violation),

!isViolationDismissed(transaction, violation),


This isViolationDismissed() is used to determine if we can display the approve button (this is the root cause of the reported bug) here:

This also doesn't sound right, as you should be able to submit reports with violations, unless you're on a domain group with Strictly enforce expense workspace rules enabled (only available in Classic)

image

To clarify, isViolationDismissed() is used within the hasAnyViolations logic. Then hasAnyViolations is used in canApprove to return false only if there are violations and shouldConsiderViolations is true:

return isExpense && isProcessing && !!isApprovalEnabled && (!hasAnyViolations || !shouldConsiderViolations) && reportTransactions.length > 0 && isCurrentUserManager;


As for the broken connection violation, search for dismissedByEmail in Auth's auth/lib/Violations.cpp so you can see the different conditions

The logic in this PR aligns with this comment in Auth:

https://github.com/Expensify/Auth/blob/d6c4017a8bf00f477db56ad3cadf8863a9e054b3/auth/lib/Violations.cpp#L439-L440

// RTER violations on instant submit reports only need to be dismissed by one person to be considered dismissed

You can also see a log here showing that the approver did receive the dismissed violation data:

https://logs.expensify.com/goto/f57262f0-bf3d-11f0-aa21-6b7684ca60b0

@rayane-d rayane-d requested a review from Krishna2323 November 19, 2025 23:46
@pecanoro
Copy link
Contributor

@Krishna2323 Can you re-review the PR and test it to make sure it works well?

@Krishna2323
Copy link
Contributor

I will start reviewing this in an hour.

@Krishna2323
Copy link
Contributor

Reviewing...

@Krishna2323
Copy link
Contributor

@rayane-d one report preview shows a “Review” button when there’s a violation in the preview, but on the expense details page I don’t see any violation.

Another report preview shows a “View” button even though the expense has a violation.

Are both of these expected?

Monosnap.screencast.2025-11-21.01-51-41.mp4

@rayane-d
Copy link
Contributor Author

@Krishna2323 - This is because the Onyx exported state contains masked data - specifically, the violation.name and transaction.comment fields are masked. That's why I included steps in the PR test instructions to correct the data for that transaction and violation. To test other transactions, you will need to execute snippets in the console to correct masked data for them.

@Krishna2323
Copy link
Contributor

Hmm 🤔, I'm pretty sure that I executed snippets in the console. Will try again, maybe I did something wrong.

@Krishna2323
Copy link
Contributor

Krishna2323 commented Nov 21, 2025

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
    • MacOS: Desktop
  • 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 there are no new alerts related to the canBeMissing param for useOnyx
  • 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 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.ts 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 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.
  • 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_native.mp4
Android: mWeb Chrome
android_chrome.mp4
iOS: HybridApp
ios_native.mp4
iOS: mWeb Safari
MacOS: Chrome / Safari
web_chrome.mp4
MacOS: Desktop
desktop_app.mp4

Copy link
Contributor

@Krishna2323 Krishna2323 left a comment

Choose a reason for hiding this comment

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

Everything looks good and works well. I wasn’t able to test on mWeb Safari, but I don’t think that’s a blocker.

@rayane-d could you please fix the ESLint check? Thanks!

@melvin-bot melvin-bot bot requested a review from mountiny November 21, 2025 11:18
@rayane-d
Copy link
Contributor Author

@rayane-d could you please fix the ESLint check? Thanks!

Fixed

@pecanoro
Copy link
Contributor

@cead22 All yours!

import type {Attendee, Participant, SplitExpense} from '@src/types/onyx/IOU';
import type {Errors, PendingAction} from '@src/types/onyx/OnyxCommon';
import type {OnyxData} from '@src/types/onyx/Request';
// eslint-disable-next-line @typescript-eslint/no-deprecated
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// eslint-disable-next-line @typescript-eslint/no-deprecated
// eslint-disable-next-line @typescript-eslint/no-deprecated

// Further filter to only violations visible to the current user
shouldShowViolation(report, policy, violation.name, currentUserEmail),
);
// Check if there is pending rter violation in the filtered violations
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Check if there is pending rter violation in the filtered violations
// Check if there is pending rter violation in the filtered violations

currentUserEmail: string,
iouReport: OnyxEntry<Report>,
policy: OnyxEntry<Policy>,
// eslint-disable-next-line @typescript-eslint/no-deprecated
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// eslint-disable-next-line @typescript-eslint/no-deprecated
// eslint-disable-next-line @typescript-eslint/no-deprecated

@cead22 cead22 merged commit 40f4ca2 into Expensify:main Nov 24, 2025
31 checks passed
@rayane-d rayane-d deleted the fix-approve-button-not-shown-because-of-brokenCardConnection-violation branch November 24, 2025 20:08
const hasFieldErrors = hasMissingSmartscanFields(transaction);
const isPaidGroupPolicy = isPaidGroupPolicyUtil(iouReport);
const hasViolationsOfTypeNotice = hasNoticeTypeViolation(transaction, violations, true) && isPaidGroupPolicy;
const currentUserEmail = getCurrentUserEmail();
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't use getCurrentUserEmail function anymore please, please pass data from UI. I will fix in here

return false;
}

const currentUserAccountID = deprecatedCurrentUserAccountID;
Copy link
Contributor

Choose a reason for hiding this comment

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

@rayane-d why are we still using deprecatedCurrentUserAccountID here even though it’s marked as deprecated?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

@rayane-d @Krishna2323 Could you please create a PR to remove the usage of deprecatedCurrentUserAccountID?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry about that, @DylanDylann — I got confused between deprecatedCurrentUserAccountID and deprecatedCurrentUserEmail. #74738 (comment)

@rayane-d are you available to raise the PR, or should I?

Copy link
Contributor

Choose a reason for hiding this comment

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

When a variable is marked as deprecated like deprecatedCurrentUserAccountID and deprecatedCurrentUserEmail, please don't introduce new usage of it anymore BUT if it already been used before and you only update that logic, It's fine to keep it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, please avoid using functions like getCurrentUserEmail that rely on Onyx.connect. Onyx.connect is deprecated and needs to be fully removed from our app. This means functions like getCurrentUserEmail will also be removed, so please don’t use them in new code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rayane-d @Krishna2323 Could you please create a PR to remove the usage of deprecatedCurrentUserAccountID?

Working on a PR 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A LOT of places to update: #76171 WIP

@IuliiaHerets
Copy link

@rayane-d can you please share QA steps?

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/cead22 in version: 9.2.64-0 🚀

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

@Krishna2323
Copy link
Contributor

Krishna2323 commented Nov 26, 2025

@IuliiaHerets the QA steps should be the same as the tests section. Sorry for missing that.

cc: @rayane-d

@IuliiaHerets
Copy link

IuliiaHerets commented Nov 26, 2025

@Krishna2323 We don’t have access to the link from Step 1. Pasting the code into the console doesn’t generate a report as described in Step 3. It seems the steps are still incorrect

bandicam.2025-11-26.22-14-04-470.mp4

@rayane-d
Copy link
Contributor Author

@Krishna2323 We don’t have access to the link from Step 1. Pasting the code into the console doesn’t generate a report as described in Step 3. It seems the steps are still incorrect

bandicam.2025-11-26.22-14-04-470.mp4

@IuliiaHerets I've DMed you the file in Slack 👍

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/marcaaron in version: 9.2.64-5 🚀

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

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.

9 participants