-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: handle failure to send mls messages (WPB-2300) #15369
Conversation
if (isBackendError(error)) { | ||
await this.updateMessageAsFailed(conversation, payload.messageId, error); | ||
} | ||
await this.updateMessageAsFailed(conversation, payload.messageId, error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could alternatively check for Axios errors with isAxiosError(error)
but I think we would want to treat any error as a failure to send with the option to retry
Codecov Report
@@ Coverage Diff @@
## dev #15369 +/- ##
==========================================
- Coverage 43.21% 43.21% -0.01%
==========================================
Files 647 647
Lines 21784 21782 -2
Branches 5006 5004 -2
==========================================
- Hits 9415 9414 -1
+ Misses 11165 11164 -1
Partials 1204 1204 |
@@ -1187,7 +1184,7 @@ export class MessageRepository { | |||
return undefined; | |||
} | |||
|
|||
private async updateMessageAsFailed(conversationEntity: Conversation, eventId: string, error: BackendError) { | |||
private async updateMessageAsFailed(conversationEntity: Conversation, eventId: string, error: BackendError | any) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we go with just unknown
and check what type of error it is inside the method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like this?
if (isBackendError(error) && error.label === BackendErrorLabel.FEDERATION_REMOTE_ERROR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
Issues
when sending a message to an mls conversation, the option to retry do not appear when the owning b-e is offline
same thing when sending a message while internet is offline using api v4
wrong styling in some cases
Solutions
bump core to 40.5.4, see fix: handle error when sending mls message [WBP-2300] wire-web-packages#5254
handle
AxiosError
as failure to sendmake sure error messages appear in red, and unsent messages gray