Page MenuHomePhabricator

[native] introduce localID field to onPressReact function
ClosedPublic

Authored by ginsu on Dec 30 2022, 4:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jul 1, 9:44 AM
Unknown Object (File)
Mon, Jul 1, 9:44 AM
Unknown Object (File)
Mon, Jul 1, 9:44 AM
Unknown Object (File)
Mon, Jul 1, 9:44 AM
Unknown Object (File)
Mon, Jul 1, 9:38 AM
Unknown Object (File)
Sun, Jun 30, 3:08 PM
Unknown Object (File)
Mon, Jun 24, 12:10 AM
Unknown Object (File)
Sun, Jun 23, 6:19 AM
Subscribers

Details

Summary

introduce localID field to onPressReact function. This diff also handles creating the localID variable on the client using the localIDPrefix and nextLocalID state


Depends on D6119
Linear Task: ENG-2519

Test Plan

Please watch this demo video to show that we were able to get the localID succesfully from the native client to db:

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ginsu edited the test plan for this revision. (Show Details)
ginsu added reviewers: atul, tomek.
ginsu requested review of this revision.Dec 30 2022, 4:13 PM
native/chat/reaction-message-utils.js
18–31 ↗(On Diff #20458)

Lots of props... might be better to use an object

tomek requested changes to this revision.Jan 2 2023, 5:37 AM
tomek added inline comments.
native/chat/reaction-message-utils.js
17–28 ↗(On Diff #20458)

Not sure if this makes a big difference for us, but it would be better if we could make sure that type parameter of route is the same as for navigation. Currently, it is possible to have e.g. route for 'TextMessageTooltipModal' and navigation for MultimediaMessageTooltipModal.

31–39 ↗(On Diff #20458)

Can't we make reactionMessageLocalID non-nullable so that the invariant isn't necessary?

This revision now requires changes to proceed.Jan 2 2023, 5:37 AM
native/chat/reaction-message-utils.js
18–31 ↗(On Diff #20458)

Created a task to address this since the changes are a bit more involved and I would consider them outside the scope of this diff

31–39 ↗(On Diff #20458)

I can definitely do that. My original thinking for this was that I thought it would be a bit weird if the other tooltip onPress action functions like copy and thread had access to this field, but if we still think setting reactionMessageLocalID to be non-nullable is the best solution forward, I will make the necessary update

ginsu edited the summary of this revision. (Show Details)

address feedback

tomek added inline comments.
native/chat/reaction-message-utils.js
31–39 ↗(On Diff #20458)

You're right. If we have to choose between this being optional and having to provide this value for unrelated actions, then keeping it optional is better.

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