Make sure failed messages enter error state (#4210)
parent
85782aeb93
commit
2897b79bef
|
@ -830,9 +830,10 @@ export class Convo {
|
|||
if (NETWORK_FAILURE_STATUSES.includes(e.status)) {
|
||||
this.pendingMessageFailure = 'recoverable'
|
||||
} else {
|
||||
this.pendingMessageFailure = 'unrecoverable'
|
||||
|
||||
switch (e.message) {
|
||||
case 'block between recipient and sender':
|
||||
this.pendingMessageFailure = 'unrecoverable'
|
||||
this.emitter.emit('event', {
|
||||
type: 'invalidate-block-state',
|
||||
accountDids: [
|
||||
|
@ -842,9 +843,14 @@ export class Convo {
|
|||
})
|
||||
break
|
||||
case 'Account is disabled':
|
||||
this.pendingMessageFailure = 'unrecoverable'
|
||||
this.dispatch({event: ConvoDispatchEvent.Disable})
|
||||
break
|
||||
case 'Convo not found':
|
||||
case 'Account does not exist':
|
||||
case 'recipient does not exist':
|
||||
case 'recipient requires incoming messages to come from someone they follow':
|
||||
case 'recipient has disabled incoming messages':
|
||||
break
|
||||
default:
|
||||
logger.warn(
|
||||
`Convo handleSendMessageFailure could not handle error`,
|
||||
|
@ -857,6 +863,7 @@ export class Convo {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
this.pendingMessageFailure = 'unrecoverable'
|
||||
logger.error(e, {
|
||||
context: `Convo handleSendMessageFailure received unknown error`,
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue