Skip to content

Reports - After deleting report, filter buttons are not responsive and do not open list #65410

Closed

Description

@lanitochka17

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.1.74-9
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/6414951
Email or phone of affected tester (no customers): jiodnjsoijdoi@gmail.com
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.expensify.com
  2. Create a new workspace.
  3. Go to workspace chat.
  4. Submit two expenses to the workspace chat.
  5. Open the expense report.
  6. Click More > Delete.
  7. Delete the report.
  8. Go to Reports > Expenses.
  9. Click Type:Expense button or other filters button like Status, Date and From.

Expected Result:

Filter buttons will be responsive and open type list.

Actual Result:

After deleting report, filter buttons are not responsive and do not open type list.

Workaround:

Unknown

Platforms:

Select the officially supported platforms where the issue was reproduced:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop
Platforms Tested: On which of our officially supported platforms was this issue tested:
  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Bug6876966_1751542326211.20250703_192721.mp4

View all open jobs on GitHub

Activity

  1. melvin-bot commented on Jul 3, 2025

    @melvin-bot

    Triggered auto assignment to @youssef-lr (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  2. github-actions commented on Jul 3, 2025

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  3. melvin-bot commented on Jul 3, 2025

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  4. lanitochka17 commented on Jul 3, 2025

    @lanitochka17
    Author

    Video production:

    Recording.3359.mp4
  5. Eskalifer1 commented on Jul 3, 2025

    @Eskalifer1
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Reports - After deleting report, filter buttons are not responsive and do not open list

    What is the root cause of that problem?

    The reason is this if:

    if (!previousValue && willAlertModalBecomeVisible) {
    return false;
    }

    The value of willAlertModalBecomeVisible is true, so we get into this if

    What changes do you think we should make in order to solve the problem?

    When deleting, we need to set the state for MODAL to false:
    `

    <ConfirmModal
    title={translate('iou.deleteReport')}
    isVisible={isDeleteReportModalVisible}
    onConfirm={() => {
    setIsDeleteReportModalVisible(false);
    Navigation.goBack();
    InteractionManager.runAfterInteractions(() => {
    deleteAppReport(moneyRequestReport?.reportID);
    });
    }}
    onCancel={() => setIsDeleteReportModalVisible(false)}
    prompt={translate('iou.deleteReportConfirmation')}
    confirmText={translate('common.delete')}
    cancelText={translate('common.cancel')}
    danger
    shouldEnableNewFocusManagement
    />

    onConfirm={() => {
                        setIsDeleteReportModalVisible(false);
    
                        Navigation.goBack();
                        InteractionManager.runAfterInteractions(() => {
                            deleteAppReport(moneyRequestReport?.reportID);
                        });
                        willAlertModalBecomeVisible(false)
                    }}

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    None

    What alternative solutions did you explore? (Optional)

    We can wrap the Navigation.goBack() with setNavigationActionToMicrotaskQueue if this will not break anything

    Navigation.setNavigationActionToMicrotaskQueue(() => Navigation.goBack());

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  6. BlameGPT commented on Jul 3, 2025

    @BlameGPT
    Contributor

    Possible culprit PRs for this issue

    • Add 'action:pay/export' filter #63753: Introduced extensive changes to SearchQueryUtils, SearchUIUtils, and SearchAutocompleteList – the core modules used by the report-filter chips – so breaking them can leave the Type/Status/Date filter menus unresponsive after a report is deleted.
    • MED Refactor ShowContextMenuContext to pass isReportArchived instead of rNVPs #65179: Large refactor touching ShowContextMenuContext and OptionsListUtils, components utilised by dropdown / popover menus across the Reports page, making it plausible that the refactor prevents the filter popovers from opening after navigation following a delete.

    If not above, check these

    • Use ReanimatedModal for FULLSCREEN modals #64805: Switching BaseModal to the new ReanimatedModal for FULLSCREEN/BOTTOM_DOCKED modals could leave an invisible backdrop after the Delete-report confirmation modal closes, blocking clicks on the filter buttons that follow.
  7. daledah commented on Jul 3, 2025

    @daledah
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    After deleting report, filter buttons are not responsive and do not open type list.

    What is the root cause of that problem?

    This comes from #64805

    After deleting the report, we go back to previous route without waiting for the current confirmation modal to be closed, leads to this logic is not properly handled

    onModalHide={hideModal}

    const hideModal = useCallback(
    (callHideCallback = true) => {
    if (areAllModalsHidden()) {
    willAlertModalBecomeVisible(false);
    if (shouldSetModalVisibility && !Navigation.isTopmostRouteModalScreen()) {
    setModalVisibility(false);
    }
    }
    if (callHideCallback) {
    onModalHide();
    }
    onModalDidClose();
    ComposerFocusManager.refocusAfterModalFullyClosed(uniqueModalId, restoreFocusType);
    },
    [shouldSetModalVisibility, onModalHide, restoreFocusType, uniqueModalId],
    );

    So willAlertModalBecomeVisible remains true, so this logic always returns false

    const toggleOverlay = useCallback(() => {
    setIsOverlayVisible((previousValue) => {
    if (!previousValue && willAlertModalBecomeVisible) {
    return false;
    }

    Previously, this issue doesn't happen on large screen, because we use ReactNativeModal which calls onModalHide on unmount (more info in this comment). But now we use ReanimatedModal, which doesn't have similar implementation.

    What changes do you think we should make in order to solve the problem?

    To prevent similar issue appear in the future, we should fix DropdownButton

    #63996 was created to fix the issue where we can open 2 dropdown buttons at the same time. But it accidentally also affects behaviour if there's other modals. So we can limit the logic to only apply when DropdownButton is already rendered on screen.

    Add a previous value for willAlertModalBecomeVisible in DropdownButton

    const prevWillAlertModalBecomeVisible = usePrevious(willAlertModalBecomeVisible);

    Then update here

    if (!previousValue && willAlertModalBecomeVisible) {

    if (!previousValue && willAlertModalBecomeVisible && prevWillAlertModalBecomeVisible === false) {

    This way, when navigating from other pages, prevWillAlertModalBecomeVisible will be undefined and will not satisfy the condition above.

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    None

    What alternative solutions did you explore? (Optional)

    For MoneyRequestView, we should close the modal before going back

    Navigation.goBack();

    close(() => Navigation.goBack())

    Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

  8. daledah commented on Jul 3, 2025

    @daledah
    Contributor

    I've fixed a similar issue before so I can help raise a quick PR if needed.

  9. youssef-lr commented on Jul 3, 2025

    @youssef-lr
    Contributor

    @daledah #63996 is in production though. Why is this not reproducible there?

  10. daledah commented on Jul 3, 2025

    @daledah
    Contributor

    @youssef-lr I updated the RCA and the offending PR.

  11. youssef-lr commented on Jul 3, 2025

    @youssef-lr
    Contributor

    @daledah I reverted that PR locally and I can still reproduce

  12. daledah commented on Jul 3, 2025

    @daledah
    Contributor

    @youssef-lr Turns out the confirm modal is not affected by that PR, I'll spend some more time to look further on this issue 👀

    Anyways the RCA is incorrect but the solution definitely works 😂

  13. youssef-lr commented on Jul 3, 2025

    @youssef-lr
    Contributor

    yeah, we need to figure out why willAlertModalBecomeVisible doesn't go back to false after deleting a report/expense. https://expensify.slack.com/archives/C02NK2DQWUX/p1751560434146609?thread_ts=1751552145.326369&cid=C02NK2DQWUX

  14. youssef-lr commented on Jul 3, 2025

    @youssef-lr
    Contributor

    @daledah the offending PR is here https://github.com/Expensify/App/pull/64865/files#diff-c5dd0a065b12f253786ab2916473640a80014957475696db4d97bedc23f47af2L166 and this part of the code is what used to set that value back to false. If you can figure out a fix without reverting feel free to make a proposal! We should also test the linked issue of the offending PR is not reproducible too.

  15. Eskalifer1 commented on Jul 3, 2025

    @Eskalifer1
    Contributor

    My alternative proposal works, we use the same approach in another modal window:

    if (goBackRoute) {
    Navigation.setNavigationActionToMicrotaskQueue(() => navigateOnDeleteExpense(goBackRoute));
    }

    cc: @youssef-lr

  16. youssef-lr commented on Jul 3, 2025

    @youssef-lr
    Contributor

    I think it's best to wait for @bernhardoj's input as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions