An ATproto social media client -- with an independent Appview.

Make sure failed messages enter error state (#4210)

authored by

Eric Bailey and committed by
GitHub
2897b79b 85782aeb

+9 -2
+9 -2
src/state/messages/convo/agent.ts
··· 830 830 if (NETWORK_FAILURE_STATUSES.includes(e.status)) { 831 831 this.pendingMessageFailure = 'recoverable' 832 832 } else { 833 + this.pendingMessageFailure = 'unrecoverable' 834 + 833 835 switch (e.message) { 834 836 case 'block between recipient and sender': 835 - this.pendingMessageFailure = 'unrecoverable' 836 837 this.emitter.emit('event', { 837 838 type: 'invalidate-block-state', 838 839 accountDids: [ ··· 842 843 }) 843 844 break 844 845 case 'Account is disabled': 845 - this.pendingMessageFailure = 'unrecoverable' 846 846 this.dispatch({event: ConvoDispatchEvent.Disable}) 847 847 break 848 + case 'Convo not found': 849 + case 'Account does not exist': 850 + case 'recipient does not exist': 851 + case 'recipient requires incoming messages to come from someone they follow': 852 + case 'recipient has disabled incoming messages': 853 + break 848 854 default: 849 855 logger.warn( 850 856 `Convo handleSendMessageFailure could not handle error`, ··· 857 863 } 858 864 } 859 865 } else { 866 + this.pendingMessageFailure = 'unrecoverable' 860 867 logger.error(e, { 861 868 context: `Convo handleSendMessageFailure received unknown error`, 862 869 })