[lib] Stop processOutboundMessages loop when it becomes outdated
Summary:
This addresses ENG-9454 and ENG-9448.
When we update this callback, we should make sure we stop running old versions of the callback. Otherwise, there's a risk that we'll process new data with callbacks that are bound to old versions of the Redux state.
Test Plan:
I had a repro of ENG-9448 where I simply logged out and back in with my t125 test user. After this diff:
- I no longer see Cannot read properties of undefined errors
- The robotext messages are delivered for all of my Farcaster friends
Reviewers: varun, will, tomek, kamil
Reviewed By: varun
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D13563