Skip to content

[Onyx Audit] Remove allowDynamicKey from useOnyx #80096

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 allowDynamicKey configuration controls whether the key can be changed dynamically during the component lifecycle. This prop is only neccessary for the Search snapshots in E/App's Onyx wrapper, so it's basically one product feature that is "leaking" into Onyx state management library.

We need to explore our Onyx wrapper to see if it’s possible to remove it (do we still need this?), or use an alternative approach.

Activity

  1. mountiny commented on Jan 21, 2026

    @mountiny
    Contributor

    We need to explore our Onyx wrapper to see if it’s possible to remove it (do we still need this?), or use an alternative approach.

    Would be great to explore this, the snapshot should be changed in future to only point to live data, right @luacmartins (sorry I might be out of date).

  2. self-assigned this
    on Jan 21, 2026
  3. luacmartins commented on Jan 21, 2026

    @luacmartins
    Contributor

    As of now, the wrapper still needs it to switch back and forth between snapshot/live data. We don't have a project to deprecate the snapshot yet, but I think that'll come soon.

  4. luacmartins commented on Jan 21, 2026

    @luacmartins
    Contributor

    We've had a challenging time proposing deprecating the snapshots because of "no perceived user value". I think if we can tie it to some performance improvement, that'd be a good way to propose it. One thing we could try is measuring the Search page performance when:

    1. Remove the snapshot code from Onyx
    2. Remove useOnyx wrapper in App
  5. moved this from LOW to CRITICAL in [#whatsnext] #qualityon Jan 22, 2026
  6. moved this from CRITICAL to HIGH in [#whatsnext] #qualityon Jan 22, 2026
  7. mountiny commented on Jan 22, 2026

    @mountiny
    Contributor

    I think if we can tie it to some performance improvement, that'd be a good way to propose it

    I would love to do that, you have my 👍 it will certainly help a bit with performance but it will help a lot with making the code cleaner

  8. fabioh8010 commented on Jan 22, 2026

    @fabioh8010
    ContributorAuthor

    Nice, I agree this is the right direction if we are able to prove the performance gains

  9. luacmartins commented on Jan 22, 2026

    @luacmartins
    Contributor

    OK, so it sounds like the next step here is to create a POC branch removing the snapshot code from Onyx and the Onyx wrapper, then measuring the page performance. Does that sounds right @fabioh8010? If so, are you available to work on that? I think that might be easier once we merge this PR that uses live data for Search to-dos

  10. fabioh8010 commented on Jan 23, 2026

    @fabioh8010
    ContributorAuthor

    I don't have capacity right now (probably next week), but I'm checking if someone from the team can work on this.

  11. 65 remaining items

  12. melvin-bot commented on Apr 6, 2026

    @melvin-bot

    @fabioh8010, @luacmartins, @mallenexpensify, @JKobrynski, @Krishna2323 Huh... This is 4 days overdue. Who can take care of this?

  13. Krishna2323 commented on Apr 7, 2026

    @Krishna2323
    Contributor

    @JKobrynski I’m a bit confused about the status of this one—it should already be in prod. The reverts are a bit confusing. Could you please check? Thanks!

  14. JKobrynski commented on Apr 8, 2026

    @JKobrynski
    Contributor

    @Krishna2323 the changes are already on prod! Looking at useOnyx.ts in E/App, it doesn't use allowDynamicKey anymore. And looking at Onyx's useOnyx it doesn't support it anymore. AFAIK the reverts were caused by some changes released in some previous Onyx versions, which caused my PR to be reverted in the process, but it was reapplied again when those were addressed. Does that answer your question?

  15. melvin-bot commented on Apr 13, 2026

    @melvin-bot

    @fabioh8010, @luacmartins, @mallenexpensify, @JKobrynski, @Krishna2323 Huh... This is 4 days overdue. Who can take care of this?

  16. luacmartins commented on Apr 14, 2026

    @luacmartins
    Contributor

    Pending payment #80096 (comment)

  17. Krishna2323 commented on Apr 16, 2026

    @Krishna2323
    Contributor

    @mallenexpensify this one is ready for payments summary. No checklist needed.

  18. mallenexpensify commented on Apr 17, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @Krishna2323 due $250 via NewDot

  19. Krishna2323 commented on Apr 17, 2026

    @Krishna2323
    Contributor

    Requested in ND.

  20. laurenreidexpensify commented on Apr 20, 2026

    @laurenreidexpensify
    Contributor

    @Krishna2323 $250 approved in New Expensify

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 productionDailyKSv2Task

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions