Say undefined where the SMSC named no id for a segment it took (#101)
* Cover the ids a send gets back where the SMSC named only some of them * Say undefined where the SMSC named no id for a segment it took * Record why the merger takes the wider type, and de-duplicate the interop narrowing * Guard the numbering hole the merger must refuse, and correct the phase record
This commit is contained in:
+3
-3
@@ -37,12 +37,12 @@ const severity: Record<MessageState, number> = {
|
||||
};
|
||||
|
||||
/** The base and the part numbers one send's ids carry, or nothing when they do not spell out one message. */
|
||||
function idNumbering(smsIds: string[]): { base: string; parts: Set<number> } | undefined {
|
||||
function idNumbering(smsIds: (string | undefined)[]): { base: string; parts: Set<number> } | undefined {
|
||||
const bases = new Set<string>();
|
||||
const parts = new Set<number>();
|
||||
|
||||
for (const smsId of smsIds) {
|
||||
const numbering = parseSegmentId(smsId);
|
||||
const numbering = smsId === undefined ? undefined : parseSegmentId(smsId);
|
||||
|
||||
if (!numbering) return undefined;
|
||||
|
||||
@@ -93,7 +93,7 @@ export class DlrMerger {
|
||||
}
|
||||
|
||||
/** Registers the ids one multipart send got back, so their receipts can be merged. */
|
||||
expect(smsIds: string[]): void {
|
||||
expect(smsIds: (string | undefined)[]): void {
|
||||
if (smsIds.length < 2) return;
|
||||
|
||||
const numbering = idNumbering(smsIds);
|
||||
|
||||
Reference in New Issue
Block a user