Update backup export behavior for member labels and group updates

This commit is contained in:
trevor-signal
2026-03-09 10:58:03 -04:00
committed by GitHub
parent 351235cbeb
commit 1d5034a784
2 changed files with 10 additions and 5 deletions

View File

@@ -1348,8 +1348,12 @@ export class BackupExportStream extends Readable {
members: convo.membersV2?.map(member => { members: convo.membersV2?.map(member => {
return { return {
joinedAtVersion: member.joinedAtVersion, joinedAtVersion: member.joinedAtVersion,
...(member.labelString
? {
labelEmoji: member.labelEmoji, labelEmoji: member.labelEmoji,
labelString: member.labelString, labelString: member.labelString,
}
: undefined),
role: member.role, role: member.role,
userId: this.#aciToBytes(member.aci), userId: this.#aciToBytes(member.aci),
}; };
@@ -1452,8 +1456,7 @@ export class BackupExportStream extends Readable {
const isOutgoing = message.type === 'outgoing'; const isOutgoing = message.type === 'outgoing';
const isIncoming = message.type === 'incoming'; const isIncoming = message.type === 'incoming';
// Pacify typescript if (message.sourceServiceId && isAciString(message.sourceServiceId)) {
if (message.sourceServiceId) {
authorId = this.#getOrPushPrivateRecipient({ authorId = this.#getOrPushPrivateRecipient({
serviceId: message.sourceServiceId, serviceId: message.sourceServiceId,
e164: message.source, e164: message.source,
@@ -2003,6 +2006,8 @@ export class BackupExportStream extends Readable {
if (isGroupV2Change(message)) { if (isGroupV2Change(message)) {
updateMessage.groupChange = await this.toGroupV2Update(message, options); updateMessage.groupChange = await this.toGroupV2Update(message, options);
strictAssert(this.#ourConversation?.id, 'our conversation must exist');
patch.authorId = this.#getOrPushPrivateRecipient(this.#ourConversation);
return { kind: NonBubbleResultKind.Directionless, patch }; return { kind: NonBubbleResultKind.Directionless, patch };
} }

View File

@@ -750,7 +750,7 @@ export class BackupsService {
}; };
} catch (error) { } catch (error) {
log.warn( log.warn(
'internal validation: failed with errors', 'internal validation: failed with errors\n',
Errors.toLogFormat(error) Errors.toLogFormat(error)
); );
return { error: Errors.toLogFormat(error) }; return { error: Errors.toLogFormat(error) };