HomePhabricator
Diffusion Comm 93296ad41d22

[lib] Use queue when processing inbound messages from the DB

Description

[lib] Use queue when processing inbound messages from the DB

Summary:
Use the queue instead of processing operations in a loop.

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

Test Plan:
Disabled inbound messages processing by commenting out handleOlmMessageToDevice in usePeerToPeerMessageHandler.
On one device, created a thread, changed its name, and then its description. These operations weren't processed on another device. Refreshed the app so that the operations are read from the DB and processed. Made sure that the result is correct.

Checked what was the behavior before this diff. Surprisingly, it was the same. Using the queue here sounds more correct and feels safer, but the previous approach also works correctly.

Reviewers: kamil, inka

Reviewed By: kamil

Subscribers: ashoat

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

Details

Provenance
tomekAuthored on Oct 7 2024, 4:55 AM
Reviewer
kamil
Differential Revision
D13623: [lib] Use queue when processing inbound messages from the DB
Parents
rCOMMa8b8ff0d0f40: Rename notificationSizeValidator to isNotificationSizeValid
Branches
Unknown
Tags
Unknown