Answer every segment of an inbound concatenated message as it arrives (#83)
* Regression tests for answering every inbound segment as it arrives * Answer every segment of an inbound concatenated message as it arrives * Record the segment-by-segment answer in AGENTS.md and README * Regression tests for an empty message_id on deliver_sm_resp * Answer a deliver_sm with the empty message_id SMPP 3.4 makes it * Record Jasmin's refusal of a deliver_sm_resp message_id * Mark the Jasmin multipart deadlock fixed * Regression tests for the architecture review's findings * Give the segment id notation an owner, and every segment a status * Correct what the ids reach and what a lost group tells the application * Regression tests for a group lost to its own octet overrun * Report a group lost to its own overrun, and refuse by the command it arrived on * Keep the docs true about what a segment is answered with * Count only the answered segments of a group lost to an overrun * Report only what a lost group cost, and say which cap bit
This commit is contained in:
+12
-11
@@ -566,7 +566,7 @@ describe('sending', () => {
|
||||
|
||||
const [sms, sent] = await Promise.all([
|
||||
incoming.then(async received => {
|
||||
await received.sendResp({ smsId: 'long-id' });
|
||||
await received.sendResp();
|
||||
|
||||
return received;
|
||||
}),
|
||||
@@ -577,7 +577,7 @@ describe('sending', () => {
|
||||
assert.ok(sms.pduObjs.length > 1);
|
||||
assert.equal(sent.err, undefined);
|
||||
assert.equal(sent.pduObjs.length, 4);
|
||||
assert.deepEqual(sent.smsIds, ['long-id-1', 'long-id-2', 'long-id-3', 'long-id-4']);
|
||||
assert.deepEqual(sent.smsIds, [1, 2, 3, 4].map(part => `${sms.smsId}-${String(part)}`));
|
||||
});
|
||||
|
||||
test('carries a UCS2 message through unchanged', async t => {
|
||||
@@ -699,7 +699,12 @@ describe('receiving', () => {
|
||||
|
||||
assert.ok(answered.pduObj);
|
||||
assert.equal(answered.pduObj.cmdName, 'deliver_sm_resp');
|
||||
assert.equal(answered.pduObj.params.message_id, 'inbound-id');
|
||||
assert.equal(
|
||||
paramText(answered.pduObj.params.message_id),
|
||||
'',
|
||||
'SMPP 3.4 4.6.2 leaves deliver_sm_resp\'s message_id unused',
|
||||
);
|
||||
assert.equal(sms.smsId, 'inbound-id', 'the id the application chose is still its own handle');
|
||||
});
|
||||
|
||||
test('hands a client a report as a dlr rather than as an sms', async t => {
|
||||
@@ -804,16 +809,12 @@ describe('receiving', () => {
|
||||
assert.equal(sms.message, message);
|
||||
assert.equal(sms.pduObjs.length, 2);
|
||||
|
||||
await sms.sendResp({ smsId: 'inbound-long' });
|
||||
|
||||
const ids: string[] = [];
|
||||
assert.deepEqual(await sms.sendResp(), {});
|
||||
|
||||
for (const answered of await delivered) {
|
||||
assert.ok(answered.pduObj);
|
||||
ids.push(paramText(answered.pduObj.params.message_id));
|
||||
assert.equal(paramText(answered.pduObj.params.message_id), '');
|
||||
}
|
||||
|
||||
assert.deepEqual(ids, ['inbound-long-1', 'inbound-long-2']);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -939,7 +940,7 @@ describe('delivery reports', () => {
|
||||
|
||||
const [sms] = await Promise.all([
|
||||
incoming.then(async received => {
|
||||
await received.sendResp({ smsId: 'unrequested' });
|
||||
await received.sendResp();
|
||||
|
||||
return received;
|
||||
}),
|
||||
@@ -948,7 +949,7 @@ describe('delivery reports', () => {
|
||||
|
||||
await sms.sendDlr();
|
||||
|
||||
assert.deepEqual(perSegment, ['unrequested-1', 'unrequested-2', 'unrequested-3']);
|
||||
assert.deepEqual(perSegment, [1, 2, 3].map(part => `${sms.smsId}-${String(part)}`));
|
||||
assert.equal(merged, 0);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user