Fix call history read syncs

This commit is contained in:
Jamie Kyle 2024-08-27 06:20:23 -07:00 committed by GitHub
parent 688de5a99b
commit 5a5b681b51
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 187 additions and 46 deletions

View file

@ -39,7 +39,10 @@ export async function onCallLogEventSync(
} else if (type === CallLogEvent.MarkedAsRead) {
log.info('onCallLogEventSync: Marking call history read');
try {
await DataWriter.markAllCallHistoryRead(target);
const count = await DataWriter.markAllCallHistoryRead(target);
log.info(
`onCallLogEventSync: Marked ${count} call history messages read`
);
} finally {
window.reduxActions.callHistory.updateCallHistoryUnreadCount();
}
@ -48,7 +51,11 @@ export async function onCallLogEventSync(
log.info('onCallLogEventSync: Marking call history read in conversation');
try {
strictAssert(peerId, 'Missing peerId');
await DataWriter.markAllCallHistoryReadInConversation(target);
const count =
await DataWriter.markAllCallHistoryReadInConversation(target);
log.info(
`onCallLogEventSync: Marked ${count} call history messages read`
);
} finally {
window.reduxActions.callHistory.updateCallHistoryUnreadCount();
}