You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Onyx Audit] Remove allowDynamicKey from useOnyx #80096
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.
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).
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.
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:
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
@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!
@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?
Activity
mountiny commentedon Jan 21, 2026
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).
luacmartins commentedon Jan 21, 2026
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.
luacmartins commentedon Jan 21, 2026
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:
mountiny commentedon Jan 22, 2026
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
fabioh8010 commentedon Jan 22, 2026
Nice, I agree this is the right direction if we are able to prove the performance gains
luacmartins commentedon Jan 22, 2026
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
fabioh8010 commentedon Jan 23, 2026
I don't have capacity right now (probably next week), but I'm checking if someone from the team can work on this.
65 remaining items
melvin-bot commentedon Apr 6, 2026
@fabioh8010, @luacmartins, @mallenexpensify, @JKobrynski, @Krishna2323 Huh... This is 4 days overdue. Who can take care of this?
Krishna2323 commentedon Apr 7, 2026
@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!
JKobrynski commentedon Apr 8, 2026
@Krishna2323 the changes are already on prod! Looking at useOnyx.ts in E/App, it doesn't use
allowDynamicKeyanymore. 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?melvin-bot commentedon Apr 13, 2026
@fabioh8010, @luacmartins, @mallenexpensify, @JKobrynski, @Krishna2323 Huh... This is 4 days overdue. Who can take care of this?
luacmartins commentedon Apr 14, 2026
Pending payment #80096 (comment)
Krishna2323 commentedon Apr 16, 2026
@mallenexpensify this one is ready for payments summary. No checklist needed.
mallenexpensify commentedon Apr 17, 2026
Payment Summary
Contributor+: @Krishna2323 due $250 via NewDot
Krishna2323 commentedon Apr 17, 2026
Requested in ND.
laurenreidexpensify commentedon Apr 20, 2026
@Krishna2323 $250 approved in New Expensify