mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 19:45:05 +01:00
remove pending events that failed because of permanent error
so they don't get stuck
This commit is contained in:
parent
4ce66fc8a1
commit
9721432a8c
@ -63,7 +63,17 @@ export class SendQueue {
|
||||
pendingEvent.setWaiting();
|
||||
} else {
|
||||
log.catch(err);
|
||||
pendingEvent.setError(err);
|
||||
const isPermanentError = err.name === "HomeServerError" && (
|
||||
err.statusCode === 400 || // bad request, must be a bug on our end
|
||||
err.statusCode === 403 || // forbidden
|
||||
err.statusCode === 404 // not found
|
||||
);
|
||||
if (isPermanentError) {
|
||||
log.set("remove", true);
|
||||
await pendingEvent.abort();
|
||||
} else {
|
||||
pendingEvent.setError(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user