Extra logging for GV2 UUID migration

This commit is contained in:
Fedor Indutny 2021-11-03 07:59:46 -07:00 committed by GitHub
parent 5bd7eda124
commit 7f9beef055
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 5 deletions

View file

@ -37,6 +37,7 @@ export default function updateToSchemaVersion43(
type LegacyConversationType = {
id: string;
groupId: string;
membersV2?: Array<{
conversationId: string;
}>;
@ -78,6 +79,8 @@ export default function updateToSchemaVersion43(
const legacy = (convo as unknown) as LegacyConversationType;
let result = convo;
const logId = `(${legacy.id}) groupv2(${legacy.groupId})`;
const memberKeys: Array<keyof LegacyConversationType> = [
'membersV2',
'pendingMembersV2',
@ -98,7 +101,7 @@ export default function updateToSchemaVersion43(
});
if (!uuid) {
logger.warn(
`updateToSchemaVersion43: ${legacy.id}.${key} UUID not found ` +
`updateToSchemaVersion43: ${logId}.${key} UUID not found ` +
`for ${member.conversationId}`
);
return undefined;
@ -141,14 +144,14 @@ export default function updateToSchemaVersion43(
if (oldValue.length !== 0) {
logger.info(
`updateToSchemaVersion43: migrated ${oldValue.length} ${key} ` +
`entries to ${newValue.length} for ${legacy.id}`
`entries to ${newValue.length} for ${logId}`
);
}
if (addedByCount > 0) {
logger.info(
`updateToSchemaVersion43: migrated ${addedByCount} addedByUserId ` +
`in ${key} for ${legacy.id}`
`in ${key} for ${logId}`
);
}
}