This is needed to map between ops and actions
https://linear.app/comm/issue/ENG-7103/add-an-optional-id-field-to-all-the-actions
Depends on D11280
Differential D11281
[lib] Add an optional ID field to all the actions tomek on Mar 8 2024, 2:28 AM. Authored by Tags None Referenced Files
Subscribers
Details This is needed to map between ops and actions https://linear.app/comm/issue/ENG-7103/add-an-optional-id-field-to-all-the-actions Depends on D11280 Flow
Diff Detail
Event TimelineComment Actions 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? Comment Actions @tomek is off - going to request changes to clear our queues until he's back and able to respond to the question Comment 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. Comment 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 |