Skip to content

[$250 Reports - New expense is not briefly highlighted in the list after expense is submitted #59449

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.21-3
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5857413
Email or phone of affected tester (no customers): sdjmsjoisdjods@gmail.com
Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to Reports
  3. Open FAB > Create expense > Manual
  4. Enter amount > Next
  5. Select a user and submit the expense to them

Expected Result:

The new expense will be briefly highlighted in Expenses list after the expense is submitted

Actual Result:

The new expense is not briefly highlighted in Expenses list after the expense is submitted

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Bug6788950_1743518559747.20250401_224005.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021909674146795439150
  • Upwork Job ID: 1909674146795439150
  • Last Price Increase: 2025-12-22
  • Automatic offers:
    • QichenZhu | Reviewer | 106915287
    • FitseTLT | Contributor | 106915288
Issue OwnerCurrent Issue Owner: @JS00001

Activity

  1. added
    Bug
    Daily
    on Apr 1, 2025
  2. melvin-bot commented on Apr 1, 2025

    @melvin-bot

    Triggered auto assignment to @OfstadC (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. OfstadC commented on Apr 1, 2025

    @OfstadC
    Contributor

    @lanitochka17 I'm not sure I understand what you mean by "briefly highlighted" - from the video everything looks as it should - I believe

  4. OfstadC commented on Apr 2, 2025

    @OfstadC
    Contributor

    Ignore the linked E/E GH above ^ that was on accident 😂

    But this appears to be working as expected, if i'm missing something @lanitochka17 please reopen and provide context.

    **Please note i'm OoO until next Tuesday so if it requires immediate attention, please re-apply the bug label (and re-assign me so I can take back over on Tuesday 😃 )

  5. hoangzinh commented on Apr 2, 2025

    @hoangzinh
    Contributor

    I guess what @lanitochka17 means is briefly highlighted like we invite members to a workspace

    Screen.Recording.2025-04-02.at.21.39.28.mov

    But let @lanitochka17 confirm

  6. lanitochka17 commented on Apr 2, 2025

    @lanitochka17
    Author

    @hoangzinh briefly highlighted as indicated in the test case steps

    Image

  7. hoangzinh commented on Apr 2, 2025

    @hoangzinh
    Contributor

    Then I think my recording above demonstrates correct behavior. Do you agree @lanitochka17?

  8. lanitochka17 commented on Apr 3, 2025

    @lanitochka17
    Author
  9. lanitochka17 commented on Apr 3, 2025

    @lanitochka17
    Author

    @hoangzinh The announced PR #58495 says that it is necessary to highlight recently added expenses. Please review the Pr

  10. hoangzinh commented on Apr 3, 2025

    @hoangzinh
    Contributor

    Interesting. Thank you @lanitochka17

  11. FitseTLT commented on Apr 4, 2025

    @FitseTLT
    Contributor

    Proposal

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

    Reports - New expense is not briefly highlighted in the list after expense is submitted

    What is the root cause of that problem?

    There are two problems

    1. The highlighting not working
      We use hasNewItemsRef to identify a new item is added but it is being set to false here when the effect runs for reportAction list change.
      if ((!isChat && hasTransactionsIDsChange) || hasReportActionsIDsChange || hasPendingSearchRef.current) {

      hasNewItemsRef.current = isChat ? reportActionsIDs.length > previousReportActionsIDs.length : transactionsIDs.length > previousTransactionsIDs.length;

      When it is called for transactionsIDs change because isChat is false the hasNewItemsRef will be set to true but unfortunately the effect is called again for change of report action list change but we compare transactionID list which doesnt change so it will be reset to false.
    2. The scrolling not working
      we are calling handleSelectionListScroll onLayout but it is never called as the layout doesn't change on addition of an item
      const onLayout = useCallback(() => handleSelectionListScroll(sortedSelectedData, searchListRef.current), [handleSelectionListScroll, sortedSelectedData]);

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

    1. We should update hasNewItemsRef only if hasTransactionsIDsChange like:

    if ((!isChat && hasTransactionsIDsChange) || (isChat && hasReportActionsIDsChange)) {
    hasNewItemsRef.current = isChat ? reportActionsIDs.length > previousReportActionsIDs.length : transactionsIDs.length > previousTransactionsIDs.length;
    }

    1. We should call handleSelectionListScroll when newSearchResultKey change via an effect
      useLayoutEffect(() => {
      handleSelectionListScroll(sortedSelectedData, searchListRef.current);
      // We only need to run the effect on change of newSearchResultKey to scroll to the new item.
      // eslint-disable-next-line react-compiler/react-compiler
      // eslint-disable-next-line react-hooks/exhaustive-deps
      }, [newSearchResultKey]);

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

    N / A

    What alternative solutions did you explore? (Optional)

  12. 81 remaining items

  13. QichenZhu commented on Dec 12, 2025

    @QichenZhu
    Contributor

    @OfstadC are we eligible to be paid since @FitseTLT created the PR and I reviewed it? cc @JS00001

  14. JS00001 commented on Dec 15, 2025

    @JS00001
    Contributor

    Yes, I agree, they should be paid for their work

  15. OfstadC commented on Dec 22, 2025

    @OfstadC
    Contributor

    👀

  16. OfstadC commented on Dec 22, 2025

    @OfstadC
    Contributor

    It does appear this is eligible for payment so working on this now

  17. changed the title [-][$250] Reports - New expense is not briefly highlighted in the list after expense is submitted[/-] [+][$125] Reports - New expense is not briefly highlighted in the list after expense is submitted[/+] on Dec 22, 2025
  18. melvin-bot commented on Dec 22, 2025

    @melvin-bot

    Upwork job price has been updated to $125

  19. OfstadC commented on Dec 22, 2025

    @OfstadC
    Contributor

    Payment Summary

    Contributor: @FitseTLT offer sent here paid $250 via Upwork
    Contributor+: @QichenZhu due $250 via manual NewDot request

  20. FitseTLT commented on Dec 22, 2025

    @FitseTLT
    Contributor

    @OfstadC This issue had a PR raised and fully reviewed here. I think it is eligible for full payment. cc @JS00001

  21. OfstadC commented on Dec 22, 2025

    @OfstadC
    Contributor

    I re-reviewed the SO and it does seem full payment is applicable. Redoing the offer now

  22. changed the title [-][$125] Reports - New expense is not briefly highlighted in the list after expense is submitted[/-] [+][$250 Reports - New expense is not briefly highlighted in the list after expense is submitted[/+] on Dec 22, 2025
  23. FitseTLT commented on Dec 22, 2025

    @FitseTLT
    Contributor

    @OfstadC Accepted

  24. OfstadC commented on Dec 22, 2025

    @OfstadC
    Contributor
  25. twisterdotcom commented on Dec 22, 2025

    @twisterdotcom
    Contributor

    @QichenZhu has submitted payment for this report on ND here.

    SO: https://stackoverflowteams.com/c/expensify/questions/7582

    Zapier Logs Run ID: 00040eee-d7ea-ac21-f23c-64c2faa35ba4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugExternalMonthlyNot a priorityReviewing

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions