Skip to content

[Due for payment 2026-06-30] [No QA] Avoid building archived reports Set upfront when marking all messages as read #94168

Closed

Description

@mountiny

Problem

MarkAllMessagesAsReadHandler used the useArchivedReportsIDSet hook, which subscribed to the entire REPORT_NAME_VALUE_PAIRS collection and eagerly rebuilt a full Set of archived report IDs on every collection change. That O(n) work ran continuously at startup even though the Set is only needed when the rare "mark all messages as read" keyboard shortcut fires (~6s impact on iOS for accounts with 100k reports).

Solution

The handler now subscribes directly via useOnyx(REPORT_NAME_VALUE_PAIRS) and passes the raw collection (through a ref) into markAllMessagesAsRead. The action checks isArchivedReport(reportNameValuePairs?.[key]) inline inside its existing report loop, keeping the archived check O(1) per report while eliminating the eager Set allocation and iteration.

PR

#94152

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    Reviewing
    Daily
    on Jun 22, 2026
  2. added
    Weekly
    Daily
    and removed
    Daily
    Reviewing
    Weekly
    on Jun 22, 2026
  3. changed the title [-][No QA] Avoid building archived reports Set upfront when marking all messages as read[/-] [+][Due for payment 2026-06-30] [No QA] Avoid building archived reports Set upfront when marking all messages as read[/+] on Jun 23, 2026
  4. melvin-bot commented on Jun 23, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  5. melvin-bot commented on Jun 23, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.17-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-06-30. 🎊

    For reference, here are some details about the assignees on this issue:

  6. added
    Awaiting Payment
    on Jun 29, 2026
  7. melvin-bot commented on Jun 29, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  8. melvin-bot commented on Jun 29, 2026

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@mallenexpensify)

    • 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//hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  9. ZhenjaHorbach commented on Jun 30, 2026

    @ZhenjaHorbach
    Contributor

    I think we don't need a checklist here
    Since it's performance issue

  10. mallenexpensify commented on Jul 2, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @ZhenjaHorbach due $250 via NewDot

  11. garrettmknight commented on Jul 6, 2026

    @garrettmknight
    Contributor

    $250 approved for @ZhenjaHorbach

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

Metadata

Metadata

Labels

Awaiting PaymentDailyTask

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions