Don't stop fetching backlog on error

Some servers allow fetching history from some targets but not
others. Don't completely stop fetching chat history on error.

The root cause was a variable shadowing in Client.fetchBatch.
This commit is contained in:
Simon Ser 2021-11-10 09:53:17 +01:00
parent 1206cfae37
commit 195e4ca371
2 changed files with 5 additions and 3 deletions

View file

@ -1012,8 +1012,9 @@ export default class App extends Component {
fetchBacklog(client, target, after, before) {
client.fetchHistoryBetween(target, after, before, CHATHISTORY_MAX_SIZE).catch((err) => {
this.setState({ error: "Failed to fetch history for '" + target + "': " + err });
this.receipts.delete(channel);
console.error("Failed to fetch backlog for '" + target + "': ", err);
this.setState({ error: "Failed to fetch backlog for '" + target + "'" });
this.receipts.delete(target);
this.saveReceipts();
});
}