Closed nicolas6422 closed 2 years ago
how you solved this issue ? can you comment there steps for patching package ?
I just made the changes in node_modules directly then ran patch-package https://www.npmjs.com/package/patch-package
patch isn't working for me :/
You still get the crash? Is the completion handler still getting called twice?
Yes, it's called twice and crashing again
Do you have repro steps? I am not able to repro after this patch
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
The issue has been closed for inactivity.
We've been seeing a huge number of these crashes since support for silent notifications was added (back?) in this PR https://github.com/wix/react-native-notifications/pull/587
From some research it seems like this is a common crash when the callback handler is called multiple times. After some debugging I found that I can repro when the client code takes longer than 25 seconds to complete and call the completion handler.
In that case this code will execute, calling the completion handler for me https://github.com/wix/react-native-notifications/blob/master/lib/ios/RNNotificationEventHandler.m#L53
But then sometime later it is called again here https://github.com/wix/react-native-notifications/blob/master/lib/ios/RNNotificationEventHandler.m#L43
Our current mitigation is to patch that function by first checking if the completion handler has been called. Here's the patch for reference.
Obviously, our code should not be taking more than 25 seconds, but until we can figure that out, this patch seems to work.
Full trace