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:
2026-09-12 22:37:55 +02:00
committed by GitHub
parent ca1a7473ed
commit 13e3ff8f1f
12 changed files with 121 additions and 34 deletions
+8 -1
View File
@@ -2498,11 +2498,18 @@ describe('merged delivery report bounds', () => {
test('arms nothing for a send whose ids do not number one message', () => {
const dlrMerger = merger();
dlrMerger.expect(['5cb0ea53b5d61093529174ca44e23871', '', '']);
dlrMerger.expect(['5cb0ea53b5d61093529174ca44e23871', undefined, undefined]);
assert.equal(dlrMerger.size, 0, 'an id the peer never named numbers nothing');
dlrMerger.expect(['bf53ad8b-1', '40ccdce2-2']);
assert.equal(dlrMerger.size, 0, 'nor do ids numbered off a base each');
const holed = '01a09739-0a9a-767d-ad1d-1c27667e1ca4';
// Dropping the unnamed entry rather than passing it through leaves 1 and 3 spelling out a
// whole 2-part message, and a send of 3 reports as delivered on two receipts.
dlrMerger.expect([`${holed}-1`, undefined, `${holed}-3`]);
assert.equal(dlrMerger.size, 0, 'nor does a hole between two parts of one base');
});
// A receipt for whole-3 would otherwise fill the slot whole-2 was registered for, truncating the report.