-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Ready for payment][$250] Add some basic runtime type validation in Onyx #39852
Comments
Job added to Upwork: https://www.upwork.com/jobs/~0152270829f1a6f929 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mananjadhav ( |
Triggered auto assignment to @kadiealexander ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.We need to validate if existing items and new changes have the same type before merging in Onyx. What is the root cause of that problem?New change. What changes do you think we should make in order to solve the problem?Below is the pseudo code which needs to be added in
For
For
For
|
@ShridharGoel Wouldn't we need to check if it's an
|
ProposalUpdated to use similar check for existing value and changes. |
ProposalPlease re-state the problem that we are trying to solve in this issue.We want to:
What is the root cause of that problem?We don't have such functionality in Onyx yet What changes do you think we should make in order to solve the problem?A. Updates for First there're a few considerations:
So just checking We can define a method
With the above considerations, here're the pseudo code of the changes we can make in Onyx here to filter out the invalid change, Log an alert, and check the
Then below that, when we use B. Updates for
C. Updates for
What alternative solutions did you explore? (Optional)For A., an alternative is to check update compatibility right in here before we push the |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
### Proposal Please re-state the problem that we are trying to solve in this issue. What is the root cause of that problem? What changes do you think we should make in order to solve the problem? There is the example of optimisticData variable below. (refer to tunction signIn())
We can get the old value from "key" property, and compare it with "value" property.
What alternative solutions did you explore? (Optional) |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
I think @ShridharGoel's proposal makes sense. Pending response from @roryabraham . 🎀 👀 🎀 C+ reviewed. |
Current assignee @roryabraham is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new. |
@mananjadhav That proposal won't work in many cases, as mentioned in my proposal. Some examples where that solution will cause regressions:
Can you double check on that? cc @roryabraham |
At once we pass either an object or array to |
We don't have to discard specific array elements. |
@ShridharGoel So is it correct that you're suggesting to run |
Any solution is likely to conflict with Expensify/react-native-onyx#523 |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
correct
yes |
Unfortunately the E/App PR to upgrade Onyx was reverted due to a regression from an unrelated Oynx PR. I've asked someone else to redo the upgrade PR, so there's nothing more to do here except for wait for Onyx to be fixed and upgraded again for this to go to staging. |
Not overdue. |
@roryabraham Are we expecting any updates on the Onyx version? |
@mananjadhav @roryabraham I saw the blocker issue was closed. Should we move forward with this issue? Thanks! |
Waiting for an update from @roryabraham on this one. |
Quick bump @roryabraham. Did you get chance to look at the previous comments? |
@roryabraham Can you move this issue to the next step? Thanks! |
Just checked and it seems @roryabraham is OOO. Let's wait for him to come back by this week, else will ask to reassign. |
Ok, so this is definitely out in production right now, and I think it was deployed in #42772. So that means it's been on prod for about a week. Given the unrelated delays, I suggest we pay this out right away and then close this. |
@kadiealexander this is ready for payout. Can you update the payment summary? |
Payouts due:
Upwork job is here. @dominictb please apply on Upwork, I couldn't find your account. |
@kadiealexander I don't need the Upwork payout. I have requested on NewDot. |
Withdrawn, thanks Manan! |
@kadiealexander I submitted the application on Upwork, my profile link is https://www.upwork.com/freelancers/~01f70bed1934fd35d5 Thank you |
$250 approved for @mananjadhav |
coming from https://github.com/Expensify/Expensify/issues/363913...
Problem
It is possible to queue incorrect Onyx updates from Auth. Twice now, we have seen an array used in place of an object in an Onyx update in Auth, which when merged completely removes the object and replaces it with an array.
Solution
While we recognize that there a number of more elegant solutions to this (compile time type validation of Onyx updates in the back-end being a prime candidate), we should apply a simple solution to prevent simple mistakes from having catastrophic effects, as we have seen occur in production twice already.
What this means is - let's update Onyx such that:
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @kadiealexanderThe text was updated successfully, but these errors were encountered: