Page MenuHomePhabricator

[lib] Replace cloneError() with SendMessageError
ClosedPublic

Authored by angelika on Nov 4 2024, 12:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 19, 1:53 AM
Unknown Object (File)
Mon, Dec 16, 1:56 PM
Unknown Object (File)
Mon, Dec 16, 3:52 AM
Unknown Object (File)
Mon, Dec 16, 3:52 AM
Unknown Object (File)
Mon, Dec 16, 3:52 AM
Unknown Object (File)
Mon, Dec 16, 3:52 AM
Unknown Object (File)
Mon, Dec 16, 3:52 AM
Unknown Object (File)
Mon, Dec 16, 3:52 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
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 ↗(On Diff #45586)
native/input/input-state-container.react.js
593 ↗(On Diff #45586)

Accidentally left over

native/chat/reaction-message-utils.js
118–122 ↗(On Diff #45586)

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

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

thanks for doing this

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