Page MenuHomePhabricator

[web] add starting payload to send reaction message dispatch action promise
ClosedPublic

Authored by ginsu on Dec 30 2022, 4:06 PM.
Tags
None
Referenced Files
F3373551: D6121.id20459.diff
Tue, Nov 26, 10:20 AM
F3373438: D6121.id20725.diff
Tue, Nov 26, 9:42 AM
F3373387: D6121.id20716.diff
Tue, Nov 26, 9:25 AM
Unknown Object (File)
Mon, Nov 4, 5:31 AM
Unknown Object (File)
Mon, Nov 4, 1:20 AM
Unknown Object (File)
Mon, Nov 4, 1:20 AM
Unknown Object (File)
Sat, Nov 2, 2:33 PM
Unknown Object (File)
Wed, Oct 30, 12:14 AM
Subscribers

Details

Summary

add starting payload to send reaction message dispatch action promise. This starting payload is the optimistically created reaction message.


Depends on D6120
Linear Task: ENG-2520

Test Plan

flow and this will be further tested in a subsequent diff

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

ginsu added reviewers: atul, tomek.
ginsu edited the summary of this revision. (Show Details)
ginsu requested review of this revision.Dec 30 2022, 4:18 PM
tomek requested changes to this revision.Jan 2 2023, 6:04 AM

We have to make sure our types are in sync with the code. In this diff we should update redux-types by setting a payload type of started action - it would be great if Flow could catch this.

web/chat/reaction-message-utils.js
33

I don't think it is a good idea to use invariants in a lot of places. Sometimes they are necessary, but usually can be avoided.

In this case, there's no point in having an invariant here. We can safely execute the hook without the id set. The id becomes necessary when we want to send a message, so the invariant may be added inside useCallback.

This revision now requires changes to proceed.Jan 2 2023, 6:04 AM

In this diff we should update redux-types by setting a payload type of started action

D5769 should address this, but please let me know if I missed anything

In D6121#184564, @ginsu wrote:

In this diff we should update redux-types by setting a payload type of started action

D5769 should address this, but please let me know if I missed anything

That diff looks ok now, thanks!

This revision is now accepted and ready to land.Jan 5 2023, 4:37 AM