Include additional logging around onboarding story
This commit is contained in:
parent
64827af27f
commit
0966118e1a
3 changed files with 12 additions and 4 deletions
|
@ -385,6 +385,7 @@ function markStoryRead(
|
|||
log.warn(`markStoryRead: no message found ${messageId}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const authorId = message.attributes.sourceUuid;
|
||||
strictAssert(
|
||||
authorId,
|
||||
|
@ -394,16 +395,18 @@ function markStoryRead(
|
|||
const isSignalOnboardingStory = message.get('sourceUuid') === SIGNAL_ACI;
|
||||
|
||||
if (isSignalOnboardingStory) {
|
||||
void markOnboardingStoryAsRead();
|
||||
drop(markOnboardingStoryAsRead());
|
||||
return;
|
||||
}
|
||||
|
||||
const storyReadDate = Date.now();
|
||||
|
||||
message.set(markViewed(message.attributes, storyReadDate));
|
||||
void window.Signal.Data.saveMessage(message.attributes, {
|
||||
ourUuid: window.textsecure.storage.user.getCheckedUuid().toString(),
|
||||
});
|
||||
drop(
|
||||
dataInterface.saveMessage(message.attributes, {
|
||||
ourUuid: window.textsecure.storage.user.getCheckedUuid().toString(),
|
||||
})
|
||||
);
|
||||
|
||||
const conversationId = message.get('conversationId');
|
||||
|
||||
|
|
|
@ -111,6 +111,7 @@ async function continueDownloadingOnboardingStory(): Promise<void> {
|
|||
seenStatus: SeenStatus.Unseen,
|
||||
sent_at: timestamp,
|
||||
serverTimestamp: timestamp,
|
||||
sourceDevice: 1,
|
||||
sourceUuid: signalConversation.get('uuid'),
|
||||
timestamp,
|
||||
type: 'story',
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// Copyright 2022 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import * as log from '../logging/log';
|
||||
import { getMessageById } from '../messages/getMessageById';
|
||||
import { isNotNil } from './isNotNil';
|
||||
import { DurationInSeconds } from './durations';
|
||||
|
@ -13,6 +14,7 @@ export async function markOnboardingStoryAsRead(): Promise<void> {
|
|||
);
|
||||
|
||||
if (!existingOnboardingStoryMessageIds) {
|
||||
log.warn('markOnboardingStoryAsRead: no existing messages');
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -38,6 +40,8 @@ export async function markOnboardingStoryAsRead(): Promise<void> {
|
|||
})
|
||||
.filter(isNotNil);
|
||||
|
||||
log.info('markOnboardingStoryAsRead: marked viewed');
|
||||
|
||||
await window.Signal.Data.saveMessages(messageAttributes, {
|
||||
ourUuid: window.textsecure.storage.user.getCheckedUuid().toString(),
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue