From c5ef4c47038ba65d0c01d51c78309e4fe42ff1a6 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Thu, 24 Sep 2026 00:06:22 +0200 Subject: [PATCH] Pin that maxOctets refuses Infinity, and say refuse where the changelog said drop --- CHANGELOG.md | 4 ++-- test/session.test.ts | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 789071a..1606b0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,8 +35,8 @@ - An `alert_notification` or an `outbind` from the peer is logged and left unanswered, as SMPP 3.4 gives neither a response. Each one used to emit `sessionError`, `"alert_notification" has no response command`. -- `server()` refuses a `maxOctets` below 1 or not a whole number, like its other limits. - `server({ maxOctets: 0 })` used to start and then drop every multipart message. +- `server()` refuses a `maxOctets` below 1 or not a whole number, `Infinity` included, like its + other limits. `server({ maxOctets: 0 })` used to start and then refuse every multipart message. ## 0.5.0 diff --git a/test/session.test.ts b/test/session.test.ts index 743bf5e..5e936ae 100644 --- a/test/session.test.ts +++ b/test/session.test.ts @@ -12,6 +12,7 @@ import { DlrMerger } from '../src/dlr-merger.ts'; import { PduFramer } from '../src/pdu-framer.ts'; import { ReconnectLoop } from '../src/reconnect-loop.ts'; import { Session, bindCommands } from '../src/session.ts'; +import { checkSessionOptions } from '../src/session-options.ts'; import { client } from '../src/client.ts'; import { closeAfter, closeListenerAfter } from './teardown.ts'; import { consts } from '../src/defs/constants.ts'; @@ -2694,6 +2695,7 @@ describe('option validation', () => { if (listening.server) await listening.server.close(); assert.match(listening.err?.message ?? '', /maxOctets must be 1 or more, got 0/); + assert.match(checkSessionOptions({ maxOctets: Infinity }).err?.message ?? '', /maxOctets must be 1 or more, got Infinity/); }); test('returns an error rather than rejecting on an impossible port', async () => {