Skip to content

[Due for payment 2026-03-19] [Onyx Audit] Remove allowStaleData from useOnyx #80094

Closed

Description

@fabioh8010

Coming from #71202.

In order to simplify useOnyx API (and consequently Onyx) let's work on proposing the removal of some configurations we think are anti-patterns / unnecessary at this point.

The allowStaleData configuration controls whether the data will be retrieved from cache during the first render even if there is a pending merge for the key.

This, however, looks more like an anti-pattern and prone to bugs (we should always rely on updated data) and there are only 8 usages in the entire E/App codebase. I think we can remove this property and treat these cases on E/App with more suited solutions.

Let's investigate how we can achieve E/App needs without this prop and create a proposal/plan to remove it.

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. moved this from LOW to HIGH in [#whatsnext] #qualityon Jan 22, 2026
  2. pasyukevich commented on Jan 27, 2026

    @pasyukevich
    Contributor

    I would like to work on it

  3. pasyukevich commented on Jan 28, 2026

    @pasyukevich
    Contributor

    Update:

    • Today was focused mostly with ReportScreen
    • Removed all allowStaleData flags from this screen
    • Found related commits -
    • Verified cases and issues presented with first commit that were covered by this flag - do not see any regression
  4. pasyukevich commented on Feb 4, 2026

    @pasyukevich
    Contributor

    Updates:

    After removing all allowStaleData flags from the ReportScreen do not see any issues

    Next places to check - MoneyRequestReportPreviewContent , SearchMoneyRequestReportPage

  5. pasyukevich commented on Feb 5, 2026

    @pasyukevich
    Contributor
  6. pasyukevich commented on Feb 9, 2026

    @pasyukevich
    Contributor

    Updates:

    • Validating on mobile - was not able to catch any issues today

    • Next steps

      • Gather test steps from the PRs
      • Validate them
      • Open PR with allowStaleData removal
  7. pasyukevich commented on Feb 12, 2026

    @pasyukevich
    Contributor

    Updates:

    Coming back to this issue

    Preparing the test steps from PRs

  8. pasyukevich commented on Feb 17, 2026

    @pasyukevich
    Contributor

    Attaching test cases with relation to PRs-

    PR #26772 (Sep 2023)

    URL: #26772
    Issues addressed: None (performance optimization)
    Comments: None specific to allowStaleData
    What was added: report and policies in ReportScreen withOnyx configuration
    Test cases: None documented


    PR #37596 (May 2024)

    URL: #37596
    Issue: #35906
    Issues addressed: Fix blank screen when opening chat
    Comments: None specific to allowStaleData
    What was added: reportOnyx in ReportScreen when migrating to useOnyx hook
    Test cases: Not documented in PR


    PR #40661 (May 2024)

    URL: #40661
    Issues addressed: None (adding ReportNameValuePairs key)
    Comments: None specific to allowStaleData
    What was added: reportNameValuePairsOnyx in ReportScreen
    Test cases: No specific test cases documented


    PR #52805 (Dec 2024)

    URL: #52805
    Issues addressed: Don't use report for isArchived check
    Comments: None specific to allowStaleData
    What was added: Related to reportNameValuePairsOnyx in ReportScreen
    Test cases:

    1. Create a workspace
    2. Delete the workspace
    3. Ensure the workspace chat is moved to the bottom of the LHN
    4. Ensure workspace chat has "(archived)" appended to the report title
    5. Ensure workspace chat has an archived banner instead of the composer

    PR #57607 (Feb 2025)

    URL: #57607
    Issues addressed: None (new feature scaffolding)
    Comments: None specific to allowStaleData
    What was added: Created SearchMoneyRequestReportPage with report and policies having allowStaleData: true from the start

    Test cases:

    1. Navigate to /search
    2. Navigate to /search/filters
    3. Manually navigate to /search/report/<valid_report_id>
    4. Verify Reports LHN visible
    5. Test workspace switcher on /search

    PR #63555 (May 2025)

    URL: #63555
    Issue: #63545
    Issues addressed: Stop showing skeletons on comments section of newly created report
    Comment: #63555 (comment) > "why do you think it is safe to add allowStaleData is true?"
    What was added: reportMetadata in both ReportScreen AND SearchMoneyRequestReportPage
    Test cases:

    1. Test going into report after relogging and clearing onyx data (should show loading state)
    2. Test going into report for the second time (shouldn't show reportActions loading state)
    3. Test creating report and going into it (shouldn't show reportActions loading state)
    4. Test if empty state doesn't blink in all above cases
    5. Repeat all above scenarios in report entered from Reports > Expense Reports

    PR #65625 (Jul 2025)

    URL: #65625
    Issue: #65528
    Issues addressed: Fix empty report state showing when transactions haven't been loaded yet
    Comments: None specific to allowStaleData
    What was added: chatReportMetadata in MoneyRequestReportPreviewContent
    Test cases:

    1. Clear cache and restart
    2. Enter a chat that has expenses
    3. Make sure that on report previews that have transactions the empty state isn't blinking
  9. 37 remaining items

  10. changed the title [-][Due for payment 2026-03-13] [Onyx Audit] Remove allowStaleData from useOnyx[/-] [+][Due for payment 2026-03-19] [Due for payment 2026-03-13] [Onyx Audit] Remove allowStaleData from useOnyx[/+] on Mar 12, 2026
  11. melvin-bot commented on Mar 12, 2026

    @melvin-bot

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

  12. melvin-bot commented on Mar 12, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.36-10 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-03-19. 🎊

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

  13. changed the title [-][Due for payment 2026-03-19] [Due for payment 2026-03-13] [Onyx Audit] Remove allowStaleData from useOnyx[/-] [+][Due for payment 2026-03-19] [Onyx Audit] Remove allowStaleData from useOnyx[/+] on Mar 16, 2026
  14. huult commented on Mar 18, 2026

    @huult
    Contributor

    #82657 (comment) I’ve reviewed this PR. Please count me in the payment summary, thanks.

  15. melvin-bot commented on Mar 19, 2026

    @melvin-bot

    Issue is ready for payment but no BZ is assigned. @mallenexpensify you are the lucky winner! Please verify the payment summary looks correct and complete the checklist. Thanks!

  16. melvin-bot commented on Mar 19, 2026

    @melvin-bot

    Payment Summary

    Upwork Job

    • Contributor: @fabioh8010 does not require payment (Contractor)
    • Contributor: @pasyukevich does not require payment (Contractor)
    • Reviewer: @mkhutornyi owed $250 via NewDot

    BugZero Checklist (@mallenexpensify)

    • (if NewFeature) I have created a PR for any necessary HelpDot updates, or I confirmed no updates are necessary.
    • 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
  17. mallenexpensify commented on Mar 20, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @huult due $250 via NewDot
    Contributor+: @mkhutornyi due $250 via NewDot

    If there are more I'm missing, comment/reopen. Thx.

  18. garrettmknight commented on Mar 25, 2026

    @garrettmknight
    Contributor

    $250 approved for @huult

  19. quinthar commented on Mar 28, 2026

    @quinthar
    Contributor

    Approved $250 to @mkhutornyi

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 productionTaskWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions