Ensure that ConversationController.load is resilient to errors
This commit is contained in:
parent
b4e9c278d3
commit
67cb10fcae
2 changed files with 43 additions and 26 deletions
|
@ -1139,6 +1139,7 @@
|
|||
|
||||
const stickerData = this.get('sticker');
|
||||
if (stickerData) {
|
||||
try {
|
||||
const sticker = Signal.Stickers.getSticker(
|
||||
stickerData.packId,
|
||||
stickerData.stickerId
|
||||
|
@ -1151,6 +1152,15 @@
|
|||
text: i18n('message--getNotificationText--stickers'),
|
||||
emoji,
|
||||
};
|
||||
} catch (error) {
|
||||
window.log.error(
|
||||
'getNotificationData: sticker fetch failed',
|
||||
error && error.stack ? error.stack : error
|
||||
);
|
||||
return {
|
||||
text: i18n('message--getNotificationText--stickers'),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
if (this.isCallHistory()) {
|
||||
|
|
|
@ -666,6 +666,7 @@ export class ConversationController {
|
|||
|
||||
await Promise.all(
|
||||
this._conversations.map(async conversation => {
|
||||
try {
|
||||
// This call is important to allow Conversation models not to generate their
|
||||
// cached props on initial construction if we're in the middle of the load
|
||||
// from the database. Then we come back to the models when it is safe and
|
||||
|
@ -684,6 +685,12 @@ export class ConversationController {
|
|||
});
|
||||
updateConversation(conversation.attributes);
|
||||
}
|
||||
} catch (error) {
|
||||
window.log.error(
|
||||
'ConversationController.load/map: Failed to prepare a conversation',
|
||||
error && error.stack ? error.stack : error
|
||||
);
|
||||
}
|
||||
})
|
||||
);
|
||||
window.log.info('ConversationController: done with initial fetch');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue