markStoryRead: More logging in unusual cases
This commit is contained in:
@@ -72,6 +72,7 @@ export type StoryDataType = {
|
||||
| 'sendStateByConversationId'
|
||||
| 'source'
|
||||
| 'sourceUuid'
|
||||
| 'sourceDevice'
|
||||
| 'storyDistributionListId'
|
||||
| 'timestamp'
|
||||
| 'type'
|
||||
@@ -426,16 +427,27 @@ function markStoryRead(
|
||||
!isDownloaded(matchingStory.attachment) &&
|
||||
!hasFailed(matchingStory.attachment)
|
||||
) {
|
||||
log.warn(
|
||||
`markStoryRead: not downloaded: ${messageId} ${
|
||||
matchingStory.attachment?.error
|
||||
? `error: ${matchingStory.attachment?.error}`
|
||||
: ''
|
||||
}`
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (matchingStory.readStatus !== ReadStatus.Unread) {
|
||||
log.warn(
|
||||
`markStoryRead: not unread, ${messageId} read status: ${matchingStory.readStatus}`
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const message = await getMessageById(messageId);
|
||||
|
||||
if (!message) {
|
||||
log.warn(`markStoryRead: no message found ${messageId}`);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user