Page MenuHomePhabricator

[lib] introduce sendReactionMessage success case to message reducers
ClosedPublic

Authored by ginsu on Nov 30 2022, 4:45 PM.
Tags
None
Referenced Files
F3380594: D5782.id19057.diff
Thu, Nov 28, 12:49 AM
Unknown Object (File)
Sun, Nov 24, 9:06 AM
Unknown Object (File)
Sun, Nov 24, 8:01 AM
Unknown Object (File)
Sun, Nov 24, 5:59 AM
Unknown Object (File)
Wed, Nov 13, 4:40 AM
Unknown Object (File)
Fri, Nov 8, 5:15 PM
Unknown Object (File)
Fri, Nov 8, 5:15 PM
Unknown Object (File)
Fri, Nov 8, 5:15 PM
Subscribers

Details

Summary

Introduced a new case to reduceMessageStore which was when the sendReactionMessageActionTypes success type gets dispatched. Like a lot of the other cases in reduceMessageStore when this case is true, it returns the new message store with the merged messages in them, so in this case the newly created reaction message


Depends on D5780

Linear Task: ENG-2246

Test Plan

Will continue testing in subsequent diffs. Ran this locally on native/web and nothing crashed. When I tried liking a message on my local environment this is the interaction I got, which I felt was a really strong indicator that things are working:

Please note that the reaction message in this demo is considered an "unsupported message" type and will be resolved in subsequent diffs

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

ginsu requested review of this revision.Nov 30 2022, 4:57 PM
tomek requested changes to this revision.Dec 1 2022, 4:28 AM

I have a strong feeling that we don't want to show it as a robotext - it should be an icon with a number and a message shouldn't appear on a list at all.

lib/reducers/message-reducer.js
848–868

Is there a reason behind not merging it with the previous if?

This revision now requires changes to proceed.Dec 1 2022, 4:28 AM

The robotext thing is confusing... I get that that's probably meant as some sort of intermediate state, but I don't think we should be treating reactions as a "robotext" type

@tomek @ashoat

Should have made this more clear in my test plan, but the demo still has reaction messages as a shimmed "unsupported message", and that is why it is a robotext. I am currently working on the unshimming and supporting the reaction message, and when that is done, liking a message will look something like this

Looks great!! Thanks for clarifying

addressed tomek's comments

lib/reducers/message-reducer.js
848–868

Was initially thinking I would need to do some logic before merging, but now, after getting most of the stack done locally I don't think that is the case

tomek added inline comments.
lib/reducers/message-reducer.js
855 ↗(On Diff #19147)

At some point we can consider displaying reaction optimistically on start

lib/reducers/message-reducer.js
855 ↗(On Diff #19147)

I'd agree that showing it optimistically would be good. Not sure how easy that would be... happy to have it covered by a follow-up task on Linear (please create before landing)

Looks good, please make sure to create a task for displaying reactions optimistically before landing

This revision is now accepted and ready to land.Dec 6 2022, 5:56 PM
lib/reducers/message-reducer.js
855 ↗(On Diff #19147)