Skip to content

Prepare payment- and survey-filtered actions outside list content - #106312

Closed
roryabraham wants to merge 6 commits into
mainfrom
refactor/report-actions-payment-filter
Closed

roryabraham wants to merge 6 commits into
mainfrom
refactor/report-actions-payment-filter

Conversation

@roryabraham

@roryabraham roryabraham commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

The list state provider filters hidden payments and support surveys before passing actions to content; loading, pagination, and scroll freshness keep their original inputs.

Performance

Bounded full-derived-engine benchmarks found no consistent regression over 5% or added model executions; replacement-case mount time rose 4.25%, while paired update wall times stayed within ±1.2%.

Fixed Issues

Follow-up to #105473; independent of #106280.

Tests

  1. Sign in to two test accounts in separate Chrome profiles or a normal and incognito window.
  2. In account A, use the global plus → “Start chat” and select account B's email.
  3. Use the plus beside the message box → “Create expense” → “Manual”; dismiss any location prompt with “Not now.”
  4. Create an expense for 11 with merchant “Payment filter diner.”
  5. In account B, open account A's conversation, refreshing if needed, then choose “Pay $11.00” → “Mark as paid.” No money is transferred.
  6. Confirm the request shows “Paid”; repeat with another amount to check both old and new history.
  7. Send ten three-line comments from account B so the conversation is scrollable.
  8. Scroll up and use “New messages” to reach the unread boundary, or “Latest messages” to reach the newest comment.
  9. Reload account B, scroll up, and confirm “Latest messages” returns to the final comment.
  10. Reload account A and confirm the paid requests and comments remain visible without a stuck loader or duplicate payment.
  11. For survey cases, open a disposable Chrome Guest profile, sign in to the development app, and wait for Home to load.
  12. In DevTools → Network, select “Offline,” then paste the local fixture setup below into the Console.
  13. In Inbox, open “Survey filtering verification” without reloading; confirm the unresolved ticket shows no survey.
  14. Run await surveyFilteringFixture.setState('resolved'); confirm exactly one “How was your support experience?” prompt appears.
  15. Run await surveyFilteringFixture.setState('replaced'); confirm the prompt disappears without reloading.
  16. Run await surveyFilteringFixture.setState('missing-resolution'); confirm no survey appears without a cached resolution.
  17. Close the disposable Guest profile while it is still offline to discard the local fixture and queued requests.

Desktop Chromium only. Survey screenshots use local fixtures, not server-backed ticket resolution; waiting-bank-account and direct-send payment paths remain unverified manually. Console logged style/DOM and Pusher-auth errors, plus expected offline failures.

Local survey fixture setup — development only, in an offline disposable profile
(async () => {
    if (location.hostname !== 'dev.new.expensify.com') throw new Error('Development app only');
    const onyx = window.Onyx;
    const {accountID} = (await onyx.get('session')) || {};
    if (!accountID) throw new Error('Sign in first');
    const conciergeID = await onyx.get('conciergeReportID');
    const concierge = conciergeID ? await onyx.get(`report_${conciergeID}`) : undefined;
    const repID = Object.keys(concierge?.participants || {}).map(Number).find(id => id !== accountID) || 8392101;
    const reportID = '9001063120701';
    const existing = await onyx.get(`report_${reportID}`);
    if (existing && existing.reportName !== 'Survey filtering verification') throw new Error('Fixture ID already in use');
    const origin = Date.now() - 3600000;
    const at = minute => new Date(origin + minute * 60000).toISOString().replace('T', ' ').replace('Z', '');
    const action = (index, actionName, text) => ({
        reportActionID: `${reportID}${index}`, reportID, actionName,
        actorAccountID: index === 1 ? accountID : repID, created: at(index), shouldShow: true,
        message: [{type: 'COMMENT', html: text ? `<p>${text}</p>` : '', text, originalMessage: {}}],
    });
    const created = action(1, 'CREATED', 'Support ticket opened.');
    const oldSurvey = action(2, 'SUPPORT_SURVEY', 'Previous support survey');
    const reply = action(3, 'ADDCOMMENT', 'Support reply: your issue has been reviewed.');
    const resolution = action(4, 'CLOSED', 'Resolved the support ticket.');
    const survey = action(5, 'SUPPORT_SURVEY', 'Latest support survey');
    const setState = async state => {
        if (!['unresolved', 'resolved', 'replaced', 'missing-resolution'].includes(state)) throw new Error('Unknown fixture state');
        if (state === 'replaced') {
            const current = await onyx.get(`report_${reportID}`);
            if (current?.stateNum !== 2 || current?.statusNum !== 2) await setState('resolved');
            await onyx.merge(`reportNameValuePairs_${reportID}`, {reopenedAsReportID: '9001063120702'});
            return;
        }
        const actions = [survey, ...(state === 'missing-resolution' ? [] : [resolution]), reply, oldSurvey, created];
        await onyx.multiSet({
            [`reportActions_${reportID}`]: Object.fromEntries(actions.map(item => [item.reportActionID, item])),
            [`reportActionsPages_${reportID}`]: [['-1', ...actions.map(item => item.reportActionID), '-2']],
            [`reportNameValuePairs_${reportID}`]: {},
            [`reportLoadingState_${reportID}`]: {hasOnceLoadedReportActions: true, isLoadingInitialReportActions: false},
            [`reportMetadata_${reportID}`]: {isLoadingInitialReportActions: false},
        });
        await onyx.merge(`report_${reportID}`, {
            reportID, reportName: 'Survey filtering verification', type: 'supportTicket',
            ownerAccountID: accountID, managerID: repID,
            participants: {[accountID]: {notificationPreference: 'always'}, [repID]: {notificationPreference: 'always'}},
            stateNum: state === 'unresolved' ? 0 : 2, statusNum: state === 'unresolved' ? 0 : 2,
            lastReadTime: at(60), lastVisibleActionCreated: survey.created,
            lastMessageText: reply.message[0].text, lastActorAccountID: repID,
        });
    };
    window.surveyFilteringFixture = {reportID, setState};
    await setState('unresolved');
    console.info('In Inbox, open Survey filtering verification without reloading.');
})();
  • Verify that no errors appear in the JS console

Offline tests

  1. In account B's reloaded conversation, scroll to older messages.
  2. In Chrome DevTools → Network, select “Offline.”
  3. Click “Latest messages” and confirm the final cached comment appears without a loader.
  4. Restore “No throttling,” reload, and confirm paid history and comments remain intact.

QA Steps

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

Not tested.

Android: mWeb Chrome

Not tested.

iOS: Native

Not tested.

iOS: mWeb Safari

Not tested.

MacOS: Chrome / Safari

Desktop Chromium; UI-created data and two isolated accounts.

Request created

Marked paid

Requester paid history after reload

Newest cached comment reached offline

final-payments.webm
final-payments-1.webm
offline-latest-1.webm

Expanded-scope verification: server-backed paid history and offline navigation.

Paid history with both filters outside content

Latest cached comment reached offline

Local survey fixtures; no server support ticket was resolved or replaced.

Unresolved: no survey

Resolved: latest survey only

Replacement metadata: no survey

Missing cached resolution: no survey

Resolved offline: latest survey only

final-verification.webm

@roryabraham
roryabraham requested a review from a team November 7, 2026 21:38
@codecov

codecov Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Coverage Δ
src/hooks/useReportActionsListModel.ts 100.00% <ø> (ø)
...ort/ReportActionsList/ReportActionsListContent.tsx 98.27% <ø> (+0.31%) ⬆️
...rt/ReportActionsList/useReportActionsListScroll.ts 94.00% <100.00%> (ø)
...rc/pages/inbox/report/ReportActionsListContext.tsx 93.54% <ø> (ø)
...es/inbox/report/ReportActionsListStateProvider.tsx 100.00% <100.00%> (ø)
.../pages/inbox/report/ReportActionsSkeletonGuard.tsx 92.10% <100.00%> (ø)
... and 8 files with indirect coverage changes

@roryabraham roryabraham changed the title Prepare payment-filtered actions in the list model Prepare payment- and survey-filtered actions outside list content Nov 7, 2026
@roryabraham

This comment has been minimized.

@chatgpt-codex-connector

This comment has been minimized.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: d8b7107cbc

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@roryabraham roryabraham closed this Nov 9, 2026
@roryabraham
roryabraham deleted the refactor/report-actions-payment-filter branch November 9, 2026 22:31
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.

1 participant