Page MenuHomePhabricator

[lib] Replace cloneError() with SendMessageError
ClosedPublic

Authored by angelika on Mon, Nov 4, 12:41 PM.
Tags
None
Referenced Files
F3373849: D13862.id45598.diff
Tue, Nov 26, 12:13 PM
Unknown Object (File)
Sat, Nov 23, 8:07 AM
Unknown Object (File)
Sat, Nov 23, 4:32 AM
Unknown Object (File)
Sun, Nov 17, 4:41 PM
Unknown Object (File)
Thu, Nov 14, 8:38 AM
Unknown Object (File)
Wed, Nov 13, 6:06 AM
Unknown Object (File)
Tue, Nov 12, 11:54 PM
Unknown Object (File)
Mon, Nov 11, 10:31 AM
Subscribers

Details

Summary
Test Plan

Force the error when sending message:
0. Create DM with some user

  1. Comment out error swallowing in peer-list-hooks.js
  2. Change identity address to some random address
  3. Remove device lists by dispatching an action as described in the issue
  4. Try to send a message
  5. Verify that the app doesn't crash and user can retry sending the message and you can see the error nicely in the logs

Diff Detail

Repository
rCOMM Comm
Branch
graszka22/ENG-9730
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Can you add a specific message to each SendMessageError error? I realize it wasn't there before, but it might be helpful here to have some additional context

native/chat/reaction-message-utils.js
118–122
native/input/input-state-container.react.js
593

Accidentally left over

native/chat/reaction-message-utils.js
118–122

Looks like this type is not correct, but was not correct in the past either, see here

Wondering, if we should use SendMessageError type in /lib/types/redux-types.js to catch things like this?

I am talking about this three specific actions:

  • SEND_MULTIMEDIA_MESSAGE_FAILED
  • SEND_REACTION_MESSAGE_FAILED
  • SEND_TEXT_MESSAGE_FAILED
native/chat/reaction-message-utils.js
118–122

Wondering, if we should use SendMessageError type in /lib/types/redux-types.js to catch things like this?

Good call... yeah, I think that would be best.

In addition to the changes @angelika made here to lib/types/redux-types.js, I think we should update the place(s) where the error is thrown... looks to be in lib/hooks/input-state-container-hooks.js. Hopefully we can remove the any-cast there

Update errors in lib/hooks/input-state-container-hooks.js

kamil added inline comments.
lib/hooks/input-state-container-hooks.js
255–263 ↗(On Diff #45644)

thanks for doing this

This revision is now accepted and ready to land.Wed, Nov 6, 6:00 AM