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
[Due for payment 2025-04-25] [CRITICAL] Add canBeMissing configuration option to useOnyx #58499
The backend doesn't know all the data the frontend needs, the frontend doesn't know if the we actually loaded from the backend all the data it is expecting/using. This leads to hard to debug/reproduce bugs when frontend tries to access a piece of data it thinks should exist but wasn't really loaded.
Solution:
Add a way so that we can indicate in the useOnyx calls if the data is ok to be missing or if we were expecting it to be there for sure:
We will add a new param to useOnyx called canBeMissing
We will add an ESLint rule so that all calls to useOnyx need to pass it (this is to allow us to add this param little by little instead of having to audit all useOnyx calls at once)
When the param is false and the useOnyx call returns no data, we will log an alert in production (which will create issues for us to investigate). In dev we will instead throw, to try to catch the problem before it hits production, when you are working on dev (we need to double check this, if it is throwing everywhere then let's just log instead, as we don't want to break everything)
Once all places that call useOnyx are passing the param, we will remove the ESLint rule and make the param in useOnyx mandatory
To handle the case where data is being loaded from the DB/cache, the alert won't be logged in the case status is loading and when status changes to loaded then it would log if data is null and canBeMissing was true.
We will add an ESLint rule so that all calls to useOnyx need to pass it (this is to allow us to add this param little by little instead of having to audit all useOnyx calls at once)
Thinking about this, I am not sure it will work since IIRC the ESLint rules in App run for all files and not only modified files?
Should this be on #quality as MEDIUM cuz of the below?
MEDIUM - Debugging Tools to help make fixing existing bugs easier and getting fixes to customers faster and Architectural Improvements to the underlying framework and design of the app to improve performance, scalability, and maintainability
This is holding other issues marked as critical, so I assume should be critical too.
Anyway, @fabioh8010 said he was going to work on this mid this week, so hopefully we have a PR soon.
changed the title [-]Add canBeMissing configuration option to useOnyx[/-][+][CRITICAL] Add canBeMissing configuration option to useOnyx[/+]on Mar 19, 2025
We will add an ESLint rule so that all calls to useOnyx need to pass it (this is to allow us to add this param little by little instead of having to audit all useOnyx calls at once)
Thinking about this, I am not sure it will work since IIRC the ESLint rules in App run for all files and not only modified files?
When the param is false and the useOnyx call returns no data, we will log an alert in production (which will create issues for us to investigate). In dev we will instead throw, to try to catch the problem before it hits production, when you are working on dev (we need to double check this, if it is throwing everywhere then let's just log instead, as we don't want to break everything)
I think we shouldn't throw errors on dev, I believe it could lead to widespread crashes if for example we have an useOnyx with canBeMissing set to false that is inside a component or hook that is used throughout the codebase.
@mallenexpensify This issue was critical, so the pay would be 500 for this issue. #61056 will be handled separately as a new change done later on #61076
@parasharrajat , this was updated to CRITICAL on March 18th, I think that was before I started updating CRITICAL issues to $500. (also.. it's not a set-in-stone rule that all CRITICAL will be $500, I do think that most/many should be, if they're External, to help get 👀 though). I want to avoid having to retroactively review many issues to potentially increase the amount.
Do you feel the amount of work, complexity or scope increased on the issue or PR? That could be reason for a potential price increase/
Also @ChavdaSachin you'll be invited to #expensify-open-source pretty soon. I need to create an automated process for new invites and I haven't been able to prioritize it quite yet.
@mallenexpensify do you have any update on this?
I could help you voluntarily to automate the task if it is possible.
I am really stuck on an issue for about 15 days and it is really difficult for externals to work without being on slack.
Activity
fabioh8010 commentedon Mar 14, 2025
Hey, I'm Fábio - expert agency contributor - and I would like to work on this issue!
fabioh8010 commentedon Mar 14, 2025
As discussed in Slack I will start looking mid next week
iwiznia commentedon Mar 14, 2025
Thinking about this, I am not sure it will work since IIRC the ESLint rules in App run for all files and not only modified files?
mallenexpensify commentedon Mar 18, 2025
Should this be on
#qualityas MEDIUM cuz of the below?iwiznia commentedon Mar 18, 2025
This is holding other issues marked as critical, so I assume should be critical too.
Anyway, @fabioh8010 said he was going to work on this mid this week, so hopefully we have a PR soon.
[-]Add canBeMissing configuration option to useOnyx[/-][+][CRITICAL] Add canBeMissing configuration option to useOnyx[/+]fabioh8010 commentedon Mar 19, 2025
@iwiznia We can use .eslintrc.changed.js to achieve this. It will only execute for the changed files of a PR.
I think we shouldn't throw errors on dev, I believe it could lead to widespread crashes if for example we have an
useOnyxwithcanBeMissingset tofalsethat is inside a component or hook that is used throughout the codebase.fabioh8010 commentedon Mar 19, 2025
Updates:
47 remaining items
mallenexpensify commentedon May 1, 2025
@parasharrajat you'll be due $250 for the review of #61056 , correct?
Are you due $250 (had $350 here, was a typo) for #59191 too?
Anyone else due 💰 here?
parasharrajat commentedon May 1, 2025
@mallenexpensify This issue was critical, so the pay would be 500 for this issue.
#61056 will be handled separately as a new change done later on #61076
mallenexpensify commentedon May 2, 2025
@parasharrajat , this was updated to CRITICAL on March 18th, I think that was before I started updating CRITICAL issues to $500. (also.. it's not a set-in-stone rule that all CRITICAL will be $500, I do think that most/many should be, if they're External, to help get 👀 though). I want to avoid having to retroactively review many issues to potentially increase the amount.
Do you feel the amount of work, complexity or scope increased on the issue or PR? That could be reason for a potential price increase/
parasharrajat commentedon May 2, 2025
I am fine with 250 as well for this issue instead of 500.
mallenexpensify commentedon May 2, 2025
Contributor+: @parasharrajat due $250 via NewDot
Unsure if can close so I'll leave open til it goes overdue again
mallenexpensify commentedon May 5, 2025
Closing
ChavdaSachin commentedon May 8, 2025
@mallenexpensify do you have any update on this?
I could help you voluntarily to automate the task if it is possible.
I am really stuck on an issue for about 15 days and it is really difficult for externals to work without being on slack.
Thank you.
mallenexpensify commentedon May 10, 2025
@ChavdaSachin , the co-worker I'm working with on the automation returns to work on Monday, so hopefully it won't be too much longer
Feel free to tag me in the issue to see if I can help.
parasharrajat commentedon May 23, 2025
Payment requested as per #58499 (comment)
JmillsExpensify commentedon May 29, 2025
$250 approved for @parasharrajat