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
Unknown Object (File)
Sat, Nov 30, 10:06 AM
Unknown Object (File)
Sat, Nov 30, 6:57 AM
Unknown Object (File)
Sat, Nov 30, 6:57 AM
Unknown Object (File)
Fri, Nov 29, 6:55 PM
Unknown Object (File)
Fri, Nov 29, 5:09 PM
Unknown Object (File)
Thu, Nov 28, 10:37 PM
Unknown Object (File)
Nov 26 2024, 10:20 AM
Unknown Object (File)
Nov 26 2024, 9:42 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
Lint Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #20459)

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