[lib] Check ID conflicts when processing operations
Summary:
We should check whether an entity with the same ID exists and discard an operation in a case of conflict
https://linear.app/comm/issue/ENG-9190/alternative-solution-update-canbeprocessed-functions
Test Plan:
Tested some scenarios:
- Repeated text message with the same ID
- Creating sidebars with
- the same thread ID
- the same sidebar source message ID
- the same create sidebar message ID
- Repeated changing thread settings with the same message ID prefix
Reviewers: kamil, will
Reviewed By: kamil
Subscribers: ashoat
Differential Revision: https://phab.comm.dev/D13464