Introduce Service Id Types

Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
Fedor Indutny 2023-08-10 18:43:33 +02:00 committed by Jamie Kyle
parent 414c0a58d3
commit 366b875fd2
269 changed files with 5832 additions and 5550 deletions

View file

@ -5,7 +5,7 @@ import { get, isEmpty } from 'lodash';
import { getOwn } from '../util/getOwn';
import { map, concat, repeat, zipObject } from '../util/iterables';
import { isOutgoing } from '../state/selectors/message';
import type { CustomError, MessageAttributesType } from '../model-types.d';
import type { MessageAttributesType } from '../model-types.d';
import type { SendState, SendStateByConversationId } from './MessageSendState';
import {
SendActionType,
@ -13,6 +13,11 @@ import {
SendStatus,
} from './MessageSendState';
type LegacyCustomError = Error & {
identifier?: string;
number?: string;
};
/**
* This converts legacy message fields, such as `sent_to`, into the new
* `sendStateByConversationId` format. These legacy fields aren't typed to prevent their
@ -130,7 +135,7 @@ export function migrateLegacySendAttributes(
}
function getConversationIdsFromErrors(
errors: undefined | ReadonlyArray<CustomError>,
errors: undefined | ReadonlyArray<LegacyCustomError>,
getConversation: GetConversationType
): Array<string> {
const result: Array<string> = [];