-
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
Investigate which react-native-onyx package caused the deploy blocker #12109
Comments
Triggered auto assignment to @slafortune ( |
@chiragsalian I don't see anyone assigned to this issue, so I wanted to clarify how we're handling next steps? |
I think we just need to go one version at a time and see which one breaks this behavior? I can help look into it. |
Yup i just cc'd relevant people to discuss first. But yes its basically what marc suggested. Btw marc, before going back one version at a time how about just reverting this one and testing? If its not the issue then it would make sense to revert one version at a time. |
@chiragsalian I am a little confused, but why would running this code trigger the bug? Onyx::pushUpdatesToClients([<accountID>], [["onyxMethod" => "mergecollection","key" => "reportIOUs_", "value" => []]]); |
So i don't know why it triggers the bug but it did. For some reason when updating I can demo the behavior to you as well in a video chat if you'd like. |
Weird. |
Narrowed it down to |
@chiragsalian One more thing... am still a little confused about why we would send an empty array as a collection and how we came to this conclusion? A collection passed to |
I wasn't able to reproduce this so unsure what the next steps here should be. |
Oh hmm maybe it's this: Going to test with an account that has no IOUs and see if the same happens. |
Gonna have to dive into the exciting world of updating the VM to test this theory 💀 |
So i can only answer how we came to this conclusion while testing. Its because the blocker issue mentioned a problem with adding members. When i reproduced the same on dev i looked at this line. $reportOnyxData contained values to update report and reportIOUs. So i broke them into two. I noticed when it sent a push notification for reports nothing was broken but when it attempted to send the push notification to reportIOUs things broke. As for it being empty. When i was debugging PHP I'm pretty sure $iouReports in fetchReports was empty so that's what Onyx::pushUpdatesToClients sent. As for testing steps, make sure you are on onyx version 1.0.24, you should also check if your node-modules matches the same. I had to nuke node-modules at one point. |
Alright so the reproduction is:
I don't actually think there is anything wrong with Onyx though. It's not supported to set an array as a collection so I think we should:
|
As for why it doesn't blow up in the version before the fast merge one...
merge(data) {
this.storageMap = mergeWithCustomized({}, this.storageMap, data); So in the case where we called this with an empty array instead of an object it would still return the storage map e.g. However, in the new code if you pass an array to merge(data) {
this.storageMap = Object.assign({}, fastMerge(this.storageMap, data)); So, I think we also better update Onyx so that it's not possible to ever call |
I like this plan.
Instead of fixing individual usages how about we update Onyx::pushUpdatesToClients to remove arrays (or convert them to stdClass) if $onyxUpdates "value" field is empty? |
Feel free to hop on the review and chime in there. That crossed my mind, but felt kind of magical to me so I'd be curious to get more opinions on it. I had a feeling like it's important for everyone to understand that empty arrays do not turn into objects magically and that it's up to you to responsibly pass the correct values. |
Onyx bump PR in review now. Tested and it resolves the issue here related to |
We received this deploy blocked recently. To fix it we reverted the react-native-onyx package here
We need to investigate which PR in that repo caused the problem. I suspect its this one but i haven't confirmed.
Either way, some next steps are,
cc @rory, @marcaaron & @Szymon20000 since i see you guys have updated react-native-onyx most recently.
Action Performed:
Expected Result:
Actual Result:
Workaround:
User has to refresh to see their chats.
Platform:
Where is this issue occurring?
QA reported it not working on android earlier. I'm unsure and haven't tested the failure elsewhere besides web.
The text was updated successfully, but these errors were encountered: