Skip to content

[Due for payment 2025-05-28] [$250] Android - Expense preview carousel does not scroll back after deleting expense #61555

Closed

Description

@mitarachim

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.41-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp
Email or phone of affected tester (no customers): applausetester+300402kh@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: Samsung Galaxy Z Fold 4 / Android 14
App Component: Money Requests

Action Performed:

Precondition:

  • Log in with Expensifail account.
  1. Launch Expensify app.
  2. Go to 1:1 DM.
  3. Submit two expenses.
  4. Scroll the carousel to the right to reveal the second expense.
  5. Tap on the expense preview.
  6. Long press on the second expense.
  7. Tap dropdown > Delete.
  8. Delete the expense.
  9. Tap app back button.

Expected Result:

The expense preview carousel will auto scroll back to the first expense.

Actual Result:

The expense preview carousel does not auto scroll back to the first expense, which results in a blank view as the second expense is deleted.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6823988_1746599785756.Screen_Recording_20250507_143251_Expensify.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021922399136504489350
  • Upwork Job ID: 1922399136504489350
  • Last Price Increase: 2025-05-13
Issue OwnerCurrent Issue Owner: @johncschuster

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on May 7, 2025
  2. melvin-bot commented on May 7, 2025

    @melvin-bot

    Triggered auto assignment to @johncschuster (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. bernhardoj commented on May 7, 2025

    @bernhardoj
    Contributor

    Proposal

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

    The expense preview list doesn't adjust the scroll when the last item is deleted.

    What is the root cause of that problem?

    It's a known issue of FlatList RN on Android.

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

    We can apply a workaround by calling scrollToEnd when the end is reached AND an item is deleted.

    Details:

    One way to know if an item is deleted is to detect if the content width reduces by storing both current and previous content width.

    const contentWidthRef = useRef(0);
    const prevContentWidthRef = useRef(0);
    ...
    onContentSizeChange={(w) => {
        prevContentWidthRef.current = contentWidthRef.current;
        contentWidthRef.current = w;
    }}
    

    Then, in onEndReached, if the width reduces, call scrollToEnd to adjust the scroll position.

    onEndReached={(e) => {
        if (contentWidthRef.current < prevContentWidthRef.current) {
            carouselRef.current?.scrollToEnd()
        }
    }}
    

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

    N/A

  4. melvin-bot commented on May 12, 2025

    @melvin-bot

    @johncschuster Eep! 4 days overdue now. Issues have feelings too...

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on May 13, 2025
  6. changed the title [-]Android - Expense preview carousel does not scroll back after deleting expense[/-] [+][$250] Android - Expense preview carousel does not scroll back after deleting expense[/+] on May 13, 2025
  7. melvin-bot commented on May 13, 2025

    @melvin-bot
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on May 13, 2025
  9. melvin-bot commented on May 13, 2025

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @allroundexperts (External)

  10. allroundexperts commented on May 13, 2025

    @allroundexperts
    Contributor

    @bernhardoj's proposal looks good to me. Let's go with them.

    🎀 👀 🎀 C+ reviewed

  11. 20 remaining items

  12. johncschuster commented on May 23, 2025

    @johncschuster
    Contributor

    Payment Summary (to be issued after regression window has passed)

    Contributor: @bernhardoj owed $250 via NewDot ✅
    Contributor+: @allroundexperts owed $250 via NewDot

  13. bernhardoj commented on May 24, 2025

    @bernhardoj
    Contributor

    Requested in ND.

  14. melvin-bot commented on May 28, 2025

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@johncschuster)

    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/1922399136504489350/hired)
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  15. johncschuster commented on May 28, 2025

    @johncschuster
    Contributor

    @allroundexperts can you complete the BZ Checklist above?

  16. JmillsExpensify commented on May 29, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @bernhardoj

  17. allroundexperts commented on Jun 1, 2025

    @allroundexperts
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other: Known platform bug

    Where bug was reported:

    • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment: No specific PR caused this bug. This was a limitation of the FlatList on React native android.

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion: N/A

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Precondition:

    • Table report view permission is enabled and you are on Android hybrid app.

    Test:

    1. Create more than 1 money request on a chat
    2. Scroll the expense preview list to the last item
    3. Open the expense report
    4. Delete one of the transaction
    5. Go back

    Verify the expense preview list doesn't show blank space

    Do we agree 👍 or 👎

  18. johncschuster commented on Jun 2, 2025

    @johncschuster
    Contributor

    @allroundexperts please request payment via ND. Thank you!

  19. JmillsExpensify commented on Jun 13, 2025

    @JmillsExpensify
    Contributor

    $250 approved for @allroundexperts

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions