[lib] Check the timestamps when adding thread members
Summary:
Check the timestamp and don't update the membership when the timestamp is more recent than the operation.
https://linear.app/comm/issue/ENG-9113/update-addmembersspec
Depends on D13215
Test Plan:
Tested mostly in combination with the rest of the stack.
Check if the timestamp gets properly updated: create an operation at T+1 time which adds u1, u2, and u3, and an operation at T which adds u3, and u4. The timestamps should be T+1, T+1, T+1, T respectively. Also, the membership array should contain all the members without any repetition.
Reviewers: kamil, inka
Reviewed By: inka
Subscribers: ashoat
Differential Revision: https://phab.comm.dev/D13216