Page MenuHomePhabricator

[lib] Add an optional ID field to all the actions
ClosedPublic

Authored by tomek on Mar 8 2024, 2:28 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 25, 6:39 PM
Unknown Object (File)
Mon, Nov 25, 1:45 PM
Unknown Object (File)
Mon, Nov 25, 11:30 AM
Unknown Object (File)
Sun, Nov 24, 11:12 PM
Unknown Object (File)
Sun, Nov 24, 10:13 PM
Unknown Object (File)
Sun, Nov 24, 10:12 PM
Unknown Object (File)
Sun, Nov 24, 6:11 AM
Unknown Object (File)
Sat, Nov 23, 6:00 PM
Subscribers

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

tomek requested review of this revision.Mar 8 2024, 2:44 AM

This is a big change, and complicated the types significantly. Can you explain more about why it's necessary to include these field on all actions?

kamil requested changes to this revision.Mar 12 2024, 8:15 AM

@tomek is off - going to request changes to clear our queues until he's back and able to respond to the question

This revision now requires changes to proceed.Mar 12 2024, 8:15 AM
tomek requested review of this revision.Mar 18 2024, 8:56 AM

Can you explain more about why it's necessary to include these field on all actions?

We need to know when the processing of an action is finished. This processing consists of generating 0 or more ops and applying them on the DB. We're introducing a new store, where the ops will be put and a handler that listens for new ops, applies them on the DB, and removes them from the store.

We need to know when the processing is finished, but we don't know which action generated which ops. The solution to that is introducing an optional ID to each action - with it, we will know that processing of some ops is the end of processing a given action. This field will be used in https://linear.app/comm/issue/ENG-7095/add-an-option-to-await-action-ops-processing - we're introducing a new dispatch-like function that calls dispatch with an ID and returns a promise that is resolved when the processing is finished. This is achieved by monitoring the ops store - when there are new ops with action ID which then later disappear, it means that the processing of that action is done.

This revision is now accepted and ready to land.Mar 19 2024, 4:56 AM

Rebase, update Redux types

After today's meeting, I wonder if we still need to add this ID to all actions

After today's meeting, I wonder if we still need to add this ID to all actions

With the most recent approach, described in https://linear.app/comm/issue/ENG-7040/implement-generating-and-awaiting-processed-ops, we still need an ID