Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[lib] Stop processOutboundMessages loop when it becomes outdated
Summary: This addresses [ENG-9454](https://linear.app/comm/issue/ENG-9454/cannot-read-properties-of-undefined-when-leaving-thread) and [ENG-9448](https://linear.app/comm/issue/ENG-9448/robotext-doesnt-display-for-first-farcaster-mutual). 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: 1. I no longer see `Cannot read properties of undefined` errors 2. 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
- Loading branch information