HomePhabricator
Diffusion Comm 642f52d38374

[lib] Create a queue and use it to process queued operations

Description

[lib] Create a queue and use it to process queued operations

Summary:
It is possible that we need an updated state when processing the next operation, so we need to make sure that the new state is propagated.

https://linear.app/comm/issue/ENG-9470/mitigate-risks-of-effects-running-on-outdated-data

Test Plan:
Tested that this diff doesn't introduce a regression:

  1. Receiving an edit entry operation before create entry
  2. Receiving a change thread settings operation before create thread
  3. Receiving a change thread subscription before adding as a member

Each of these produces the correct state and clears the Redux queue.

Also tested that we have a bug that this diff fixes. Created three operations that were processed in the following order:

  1. Change thread name at timestamp T+1
  2. Change thread description at T+1
  3. Create thread at T

Before this diff, there were robotexts displayed for each of these, but the thread name wasn't changed. After this diff both thread name and description are updated.

Reviewers: kamil, ashoat

Reviewed By: ashoat

Differential Revision: https://phab.comm.dev/D13572

Details

Provenance
tomekAuthored on Wed, Oct 2, 6:04 AM
Reviewer
ashoat
Differential Revision
D13572: [lib] Create a queue and use it to process queued operations
Parents
rCOMM85789c85773e: [lib] Fix SQLite migrations
Branches
Unknown
Tags
Unknown