Page MenuHomePhabricator

[lib] Apply the queued updates
ClosedPublic

Authored by tomek on Aug 1 2024, 10:15 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 7, 11:31 PM
Unknown Object (File)
Wed, Nov 6, 11:18 PM
Unknown Object (File)
Wed, Nov 6, 11:17 PM
Unknown Object (File)
Wed, Nov 6, 10:19 PM
Unknown Object (File)
Tue, Oct 22, 1:17 PM
Unknown Object (File)
Tue, Oct 22, 8:33 AM
Unknown Object (File)
Tue, Oct 22, 8:33 AM
Unknown Object (File)
Tue, Oct 22, 8:33 AM
Subscribers

Details

Summary

When a thread appears in the store, we should process all the operations that were queued for it.

https://linear.app/comm/issue/ENG-8769/apply-the-queued-updates

Depends on D12954

Test Plan

Processed an operation that updates thread name, with a thread ID that isn't present in the store. Then processed another operation that creates a thread with this ID. Checked that the name of the created thread matched the value from the first operation. Also checked that the queue no longer contains the operations.

Diff Detail

Repository
rCOMM Comm
Branch
dmops
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

lib/shared/dm-ops/dm-ops-queue-handler.react.js
45

We don't want to process operations multiple times. This ref allows us to process the operations in the first render where the thread is present.

Harbormaster returned this revision to the author for changes because remote builds failed.Aug 1 2024, 10:38 AM
Harbormaster failed remote builds in B30857: Diff 43024!
tomek requested review of this revision.Aug 2 2024, 1:51 AM
tomek edited the test plan for this revision. (Show Details)
inka added inline comments.
lib/shared/dm-ops/dm-ops-queue-handler.react.js
62 ↗(On Diff #43035)

can't we iterate over queuedOperations entries?
for (const threadID in queuedOperations)

66–68 ↗(On Diff #43035)

Can't we run ops in parallel?

lib/types/dm-ops.js
330 ↗(On Diff #43035)

This name is very hard for me to understand. Can it be 'CLEAR_QUEUED_THREAD_DM_OPS'?

This revision is now accepted and ready to land.Aug 2 2024, 7:31 AM

Rename. Run ops in parallel.

This revision was automatically updated to reflect the committed changes.