[lib] Move current user updates logic into a spec
Summary:
Introduce a new function to a spec that reduces current user store.
Use this function in a reducer - the approach is a little different from the original one:
- Instead of returning immediately, we reduce every update. There should be at most one CurrentUserUpdateInfo, which is the only update that affects this store, so it should be equivalent.
- If there were more updates affecting this store, we should apply more reductions. The updates should be sorted by timestamp on a server, so it makes sense to iterate through them using the same ordering.
- We always return for these actions instead of waiting for the default return state at the end.
Depends on D9257
https://linear.app/comm/issue/ENG-4241/handle-processupdatesactiontype-as-a-part-of-a-spec
Test Plan: Check if updating the current user from a different client works correctly.
Reviewers: kamil, bartek, inka
Reviewed By: kamil
Subscribers: ashoat, michal
Differential Revision: https://phab.comm.dev/D9268