[native] Stop calling saveMessageInfos from androidBackgroundMessageTask
Summary:
androidBackgroundMessageTask runs separately from the main app, and doesn't have any mechanisms in place to wait for redux-persist and SQLite before dispatching Redux actions.
The result of this is that the store can be messed up. See ENG-2275 for details on how this can happen.
This diff removes the saveMessageInfos call from handleAndroidMessage, which gets called in two scenarios. The first scenario is androidBackgroundMessageTask, and in that scenario we don't want to call saveMessageInfos. The second scenario is PushHandler.androidMessageReceived, and in that scenario we'll continue calling saveMessageInfos.
Since the only component we need to call saveMessageInfos from now is PushHandler, I also replaced the hacky dispatch import approach we were taking before in push/utils.js with a more idiomatic approach.
Test Plan: Confirm that issue in ENG-2275 no longer repros
Reviewers: atul, tomek, marcin
Reviewed By: tomek
Subscribers: marcin
Differential Revision: https://phab.comm.dev/D5667