It is possible that we receive an operation about viewer being added to a thread while the thread is already present in the store and viewer is its member. We need to make sure that we don't override the whole thread and instead update it as little as possible.
Depends on D13483
Unrelated to this diff, but I did some investigation as to why we still have permissions for members here.
The context is that in D12789, we removed member permissions from the SQLite DB on native clients.
I know Atul never finished it, but I was under the impression that the only thing left was to implement an equivalent migration on web.
However, looking at the types it seems like the changes were made for thin threads but NOT for thick threads.
I'm guessing Atul's work intersected with the thick threads work, and he ended up making the changes only for thin threads.
I'm not 100% sure, but I suspect we should probably do the same for thick threads as thin threads (calculate the member permissions "on the fly") instead of storing them in the DB. I created ENG-9404 to track this.