Page MenuHomePhabricator

[native][web] Queue new ops
ClosedPublic

Authored by tomek on Mar 8 2024, 9:11 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 25, 12:49 PM
Unknown Object (File)
Thu, Apr 25, 12:49 PM
Unknown Object (File)
Thu, Apr 25, 12:48 PM
Unknown Object (File)
Wed, Apr 3, 2:01 AM
Unknown Object (File)
Wed, Apr 3, 2:01 AM
Unknown Object (File)
Wed, Apr 3, 2:01 AM
Unknown Object (File)
Wed, Apr 3, 2:01 AM
Unknown Object (File)
Tue, Apr 2, 12:34 PM
Subscribers

Details

Summary

Queue operations only if they generate ops or if they have a message ID. All the other cases doesn't need to affect the queue.
The reducer had to be split in two - the ops are modified in platform-specific reducers so we need to add to queues from there. But then it is really challenging to type the reducer correctly, because it doesn't know anything about platform-specific actions and yet it needs to accept these. (Typing as BaseAction | { actionID, ...} doesn't fix the issue because the inexact object is confused with base actions).

https://linear.app/comm/issue/ENG-7097/put-the-ops-into-the-filed-when-reducers-return-them

Depends on D11281

Test Plan

On both web and native check if the ops are being added to queues.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tomek requested review of this revision.Mar 8 2024, 9:30 AM
lib/reducers/db-ops-reducer.js
24 ↗(On Diff #37953)

Nit: for consistent capitalization, it seems like this should be queueDBOps

kamil added inline comments.
lib/types/db-ops-types.js
5–8 ↗(On Diff #37953)

I guess this makes more sense.

This revision is now accepted and ready to land.Mar 12 2024, 8:42 AM

Rebase, rename

lib/types/db-ops-types.js
5–8 ↗(On Diff #37953)

I think that the current approach is better because we would like to express the case where some ops don't have an action ID. Also, modifying this type would cause a lot of trouble in other places.

Generate an ID if it isn't provided

tomek edited the test plan for this revision. (Show Details)
This revision was automatically updated to reflect the committed changes.