mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-02 00:07:56 +01:00
Update types for message.errors
Co-authored-by: trevor-signal <131492920+trevor-signal@users.noreply.github.com>
This commit is contained in:
@@ -140,7 +140,7 @@ export function migrateLegacySendAttributes(
|
||||
}
|
||||
|
||||
function getConversationIdsFromErrors(
|
||||
errors: undefined | ReadonlyArray<LegacyCustomError>,
|
||||
errors: undefined | null | ReadonlyArray<LegacyCustomError>,
|
||||
getConversation: GetConversationType
|
||||
): Array<string> {
|
||||
const result: Array<string> = [];
|
||||
|
||||
2
ts/model-types.d.ts
vendored
2
ts/model-types.d.ts
vendored
@@ -195,7 +195,7 @@ export type MessageAttributesType = {
|
||||
decrypted_at?: number;
|
||||
deletedForEveryone?: boolean;
|
||||
deletedForEveryoneTimestamp?: number;
|
||||
errors?: ReadonlyArray<CustomError>;
|
||||
errors?: ReadonlyArray<CustomError> | null;
|
||||
expirationStartTimestamp?: number | null;
|
||||
expireTimer?: DurationInSeconds;
|
||||
groupMigration?: GroupMigrationType;
|
||||
|
||||
@@ -2979,7 +2979,7 @@ export class BackupExportStream extends Readable {
|
||||
): Backups.ChatItem.IOutgoingMessageDetails {
|
||||
const sealedSenderServiceIds = new Set(unidentifiedDeliveries);
|
||||
const errorMap = new Map(
|
||||
errors.map(({ serviceId, name }) => {
|
||||
errors?.map(({ serviceId, name }) => {
|
||||
return [serviceId, name];
|
||||
})
|
||||
);
|
||||
|
||||
@@ -5824,7 +5824,7 @@ function getSortedNonAttachmentMedia(
|
||||
receivedAt: row.received_at,
|
||||
receivedAtMs: row.received_at_ms ?? undefined,
|
||||
sentAt: row.sent_at,
|
||||
errors: row.errors,
|
||||
errors: dropNull(row.errors),
|
||||
sendStateByConversationId: row.sendStateByConversationId,
|
||||
readStatus: row.readStatus,
|
||||
isErased: !!row.isErased,
|
||||
|
||||
@@ -233,7 +233,7 @@ function showLightboxForViewOnceMedia(
|
||||
isErased: !!message.get('isErased'),
|
||||
readStatus: message.get('readStatus'),
|
||||
sendStateByConversationId: message.get('sendStateByConversationId'),
|
||||
errors: message.get('errors'),
|
||||
errors: message.get('errors') ?? undefined,
|
||||
},
|
||||
},
|
||||
];
|
||||
@@ -340,7 +340,7 @@ function showLightbox(opts: {
|
||||
sourceServiceId: message.get('sourceServiceId'),
|
||||
sentAt,
|
||||
isErased: !!message.get('isErased'),
|
||||
errors: message.get('errors'),
|
||||
errors: message.get('errors') ?? undefined,
|
||||
readStatus: message.get('readStatus'),
|
||||
sendStateByConversationId: message.get('sendStateByConversationId'),
|
||||
},
|
||||
|
||||
@@ -237,7 +237,7 @@ function _cleanMessage(
|
||||
receivedAtMs: message.received_at_ms,
|
||||
sentAt: message.sent_at,
|
||||
isErased: !!message.isErased,
|
||||
errors: message.errors,
|
||||
errors: message.errors ?? undefined,
|
||||
readStatus: message.readStatus,
|
||||
sendStateByConversationId: message.sendStateByConversationId,
|
||||
};
|
||||
|
||||
@@ -2498,7 +2498,7 @@ export const getMessageDetailsSelector = createSelector(
|
||||
}
|
||||
|
||||
const {
|
||||
errors: messageErrors = [],
|
||||
errors: messageErrors,
|
||||
sendStateByConversationId = {},
|
||||
unidentifiedDeliveries = [],
|
||||
unidentifiedDeliveryReceived,
|
||||
@@ -2549,7 +2549,7 @@ export const getMessageDetailsSelector = createSelector(
|
||||
}
|
||||
|
||||
// This will make the error message for outgoing key errors a bit nicer
|
||||
const allErrors = messageErrors.map(error => {
|
||||
const allErrors = (messageErrors ?? []).map(error => {
|
||||
if (error.name === OUTGOING_KEY_ERROR) {
|
||||
return {
|
||||
...error,
|
||||
|
||||
Reference in New Issue
Block a user