We want to include pinnedCount inside ThreadInfos in order to avoid having to dynamically fetch this number each time a thread is opened. This diff handles this in two ways:
- We always want to include pinnedCount in ServerThreadInfo - then, based on the code version on native, we'd want to conditionally include it into the downstream ThreadInfo types (where we construct, for example, RawThreadInfo from ServerThreadInfo).
- Introduce a redux persist migration to target newly updated clients. Each step in the migration is commented to indicate its purpose. One case that is already handled but important to note: if an old client and a new client are in a thread together (pre and post message pinning versions), when we update the old client, we need to make sure we don't initialize pinnedCount to 0, but instead derive the pinnedCount based on the thread and existence of TOGGLE_PIN messages because there may be message pins in the thread.
Linear: https://linear.app/comm/issue/ENG-3396/store-the-number-of-pinned-messages-in-threadinfo
Depends on D7202