Page MenuHomePhabricator

[lib/native/web] switch the promise type in sendReactionMessage action from SendReactionMessageResult to SendMessageResult
ClosedPublic

Authored by ginsu on Jan 3 2023, 12:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jul 1, 9:22 AM
Unknown Object (File)
Mon, Jul 1, 9:22 AM
Unknown Object (File)
Mon, Jul 1, 9:22 AM
Unknown Object (File)
Mon, Jul 1, 9:12 AM
Unknown Object (File)
Thu, Jun 27, 7:29 PM
Unknown Object (File)
Wed, Jun 26, 11:16 PM
Unknown Object (File)
Wed, Jun 26, 8:45 PM
Unknown Object (File)
Wed, Jun 26, 2:56 PM
Subscribers

Details

Summary

switch the promise type in sendReactionMessage action from SendReactionMessageResult to SendMessageResult. Since we have a lot of the message info already stored in the local message we no longer need to return a whole new newMessageInfos and instead can follow the pattern of text and multimedia messages of returning an updated time and id which is now the server id


Linear Task: ENG-2599
Depends on D6123

Test Plan

flow and this will be tested futher in subsequent diffs

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 edited the summary of this revision. (Show Details)
Harbormaster returned this revision to the author for changes because remote builds failed.Jan 3 2023, 12:36 PM
Harbormaster failed remote builds in B15048: Diff 20529!
ginsu requested review of this revision.Jan 3 2023, 12:51 PM
tomek added inline comments.
lib/actions/message-actions.js
236 ↗(On Diff #20529)

Could you reming why do we need an interface?

This revision is now accepted and ready to land.Jan 5 2023, 8:09 AM
lib/actions/message-actions.js
236 ↗(On Diff #20529)

The`SendMessageResult` type, which is used for all locally composed message info has the interface field, and since now we are considering reaction messages as a locally composed message we should include this in the return

lib/actions/message-actions.js
236 ↗(On Diff #20529)

Ok, it makes sense to be consistent. But I was curious about why do we need this field. Is it used anywhere?

I've searched a bit and it seems like this field was introduced in D511 and then the usage was removed in D4645, so maybe we don't need this field at all. It doesn't hurt to keep it for some time, though.

lib/actions/message-actions.js
236 ↗(On Diff #20529)

Is it used anywhere?

Also seems like there are a couple of instances of interface in lib/utils/call-server-endpoint.js when we call a server endpoint.

It doesn't hurt to keep it for some time, though.

I think we should keep it for now, especially if it doesn't hurt anything, but if we truly are not using this field, we should remove it from all messages that use it (text/multimedia/reaction) so that we can have all the local message types be consistent with each other

lib/actions/message-actions.js
235–236

I believe this is why message liking is broken on build 172. In the future, we should have taken into account that removing the newMessageInfo field, which was expected by build 172, from the return, could break functionality

lib/actions/message-actions.js
235–236

I don't think this is right – this is a change in client code. The problem isn't the change in client code, the problem is that you changed keyserver code to break support for old clients. Can you try to find where you did that?