Fix push from closed state#880
Fix push from closed state#880StefanLuecke wants to merge 3 commits intowix:masterfrom StefanLuecke:master
Conversation
remove empty asset array
| try | ||
| { | ||
| response.putBundle("notification", mNotificationProps.asBundle()); | ||
| mJsIOHelper.sendEventToJS(NOTIFICATION_OPENED_EVENT_NAME, response, mAppLifecycleFacade.getRunningReactContext()); | ||
| } catch (NullPointerException e) | ||
| { | ||
| Log.e(LOGTAG, "notifyOpenedToJS: Null pointer exception"); | ||
| } |
There was a problem hiding this comment.
It actually won't fix the issue but will only prevent the app from crashing: instead of receiving a callback on JS side it will only log the "null pointer exception"
There was a problem hiding this comment.
In this case @artyorsh I would argue this solution is sufficient, taking into account:
- It has been fixed similarly in another place in the codebase, where asBundle() call can also throw null pointer exceptions/
- The "intended" behavior of the library is still very much intact, push notifications are received and open properly. Just on some specific platforms (android 12) in some cases, it seems that the bundle can be
null, and it would be better to just "bail" when there is no notification to handle rather than crash the app altogether 😅
A "root" cause for that might be more related to #837 , but @DanielEliraz should know more about that?
There was a problem hiding this comment.
Definitely better to have it caught than having the app crashing - true. But will it mean that in the bailed cases there will be no callback on JS? I think another scenario which might be related to the issue is that this function is called twice for some reasons - first time with "good" arguments and the second time with "bad". The fix will have more sense then 🙂
There was a problem hiding this comment.
after some testing, @artyorsh 's guess is right. the function is called twice, first with the null bundle, then with the correct data.
@DanielEliraz can we have your review please ?
There was a problem hiding this comment.
@DanielEliraz is this being reviewed?
| .history | ||
|
|
||
| # Typescript build | ||
| lib/dist/ |
|
Hope this will be merged soon! |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
The issue has been closed for inactivity. |
Fix push notification opening from closed state as suggested in #835 (comment)