Commit Graph

73 Commits

Author SHA1 Message Date
lilleman 793839d0e0 Point the package and README at Gitea 2026-09-13 17:57:10 +02:00
lilleman 7310634d7d Rewrite the README task-first for 1.0.0 and move the 0.4.0 guide to MIGRATION.md (#102)
Test / lint (push) Successful in 20s
Test / test (18) (push) Successful in 18s
Test / test (20) (push) Successful in 18s
Test / test (22) (push) Successful in 18s
Test / test (24) (push) Successful in 24s
Test / test (26) (push) Successful in 18s
2026-09-13 12:05:13 +02:00
lilleman 13e3ff8f1f 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
2026-09-12 22:37:55 +02:00
lilleman ca1a7473ed Declare the alphabet a GSM message is actually written in (#100)
* Regression tests for the alphabet a GSM message declares

* Declare the alphabet a GSM message is actually written in

* Reflow the composing-by-hand paragraph

* Drop the ASCII alias SMPP's flat table shares with the option's own

* Bound the receipt test's wait and tighten the notes around it
2026-09-09 21:30:55 +02:00
lilleman 989eb01763 Name the refusal rule, and refuse a period the encoder cannot spell (#99)
* Refuse a relative validity period the SMPP time format cannot hold

* Export unencodableText(), so a caller can word a refusal as the library does

* Name the refusal rule in the README, and correct what it claims

* Word the period refusal by what the encoder spells, and keep unencodableText() internal

* Correct the decision bullet premise about what the relative format holds

* Close the stability nits on the time guard and its tests
2026-09-09 20:36:13 +02:00
lilleman ef13290230 Refuse a body the PDU's own data_coding cannot carry (#98)
* Regression tests for a body the PDU's own data_coding cannot carry

* Refuse a body the PDU's own data_coding cannot carry, in the codec both send paths build through

* Record the codec's body refusal, and drop two todo entries it and the interop run close

* Regression tests for the aliased body TLV and the data_coding short_message settles

* Find the body TLV by tag id, leave data_coding to the field that will be read, and correct the record

* Record the two architecture findings this change does not close

* Regression tests for a duplicated body tag and a short_message the wire never carries

* Resolve every body TLV against the field that will be read, and move TLV writing to its table

* Regression tests for a body only the TLV carries and an empty short_message

* Let only octets the command writes settle the alphabet, and stop shadowing the TLV table
2026-09-09 19:33:36 +02:00
lilleman c06cc0648b Refuse what we cannot send: an alphabet that cannot carry the message, and a time nobody can read (#97)
* Regression tests for a named alphabet and a time that cannot carry the send

* Refuse a message the named alphabet cannot carry, and a time nobody can read

* Close the architecture review: a builder that cannot drop a time, and docs that hold

* Refuse a time of no known kind, and clamp a relative period to what the format holds

* Reflow the decision record and name the clamp in its test
2026-09-09 18:16:08 +02:00
lilleman 7d6039796d Fit every concatenated segment in an SMS, and close the encoding helpers' throw (#96)
* Regression tests for the concatenated segment budget and the encoding-name door

* Budget unpacked segments at 134 octets, and export isEncodingName

* Name the length a Latin-1 message starts costing more segments at

* Fold the totality clause into hard rule 1, and log the unrepresentable-alphabet finding

* Make the maxSegments regression discriminate, and drop the narrating comments

* State the per-alphabet capacities accurately, and log the invalid-date path
2026-09-09 17:21:51 +02:00
lilleman e80b07167c Read the GSM 03.38 message class where the spec puts it (#95)
* Regression tests for the GSM 03.38 message class behind sms.flash

* Read the GSM 03.38 message class where the spec puts it, and refuse a flash message no alphabet can carry

* Keep the code span in the message-class decision on one line

* Stop offering the flash message class as an alphabet, and check the encoding option by name

* Settle every refusable send option in one check, and record what the review left open

* Say what the flash refusal and the encoding option actually do

* Keep the README off the alphabet whose long messages do not fit
2026-09-09 16:40:32 +02:00
lilleman 079d833ea8 Fix what the product-owner pass found in the README, and log an unmergeable receipt (#94)
* Log an unmergeable receipt and correct the README where it overclaims

* Name decodeMessage's arguments and pin the hook's keepalive and unbind

* Let the test name carry what its comment restated
2026-09-08 19:43:23 +02:00
lilleman 5a0cf56754 Fixtures for the receipt bodies operator documentation publishes (#93)
* Fixtures for the receipt bodies operator documentation publishes

* Read the stat:FAILED several operators write as UNDELIVERABLE

* Cover the 16-bit UDH concatenation element with a fixture

* Record phase 9 of the interoperability plan

* Share the dummy SMSC and tighten the operator fixtures

* Correct what the test conventions claim about the doubles and the tree

* Read a receipt date that carries its century

* Read the stat spelling CM.com publishes

* Say what the receipt status table actually holds
2026-09-08 18:56:57 +02:00
lilleman 83176f53b0 Let sendSms() name the esm_class messaging mode (#92)
* Regression tests for the messaging mode on sendSms()

* Let sendSms() name the esm_class messaging mode

* Document the messaging mode option and the decision behind it

* Name the constants move for migrating consumers and share the refusal's value naming

* Cover the messaging-mode refusals through submitSms()

* Refuse transaction mode and a report under datagram mode on sendSms()

* Narrow the mode checker and name the default mode once
2026-09-08 17:30:20 +02:00
lilleman 18de565aad Reassemble a concatenated message segmented with the sar_* TLVs (#91)
* Regression tests for inbound sar_* concatenation

* Reassemble a concatenated message segmented with the sar_* TLVs

* Record the sar_* fix in the jasmin and Java-client findings

* Name the sar_* TLVs in the refusal, and separate group keys the addresses cannot forge

* Name the field a refused segment got wrong, and key groups on a separator no address holds

* Bound the new session tests, and derive Concat from the UDH fields
2026-09-06 21:03:14 +02:00
lilleman 30eedc81ee Let a signal abort a send queued behind a full send window (#90)
* Regression tests for aborting a send queued behind a full window

* Let a signal abort a send queued behind a full send window

* Log a queued send, tighten its regression tests and settle the decision record

* Take the send window's queue off an array so an abort cannot stall the loop

---------

Co-authored-by: Mikael Göransson <mikael.goransson@timewave.se>
2026-09-06 18:17:01 +02:00
lilleman bcbb042c1b Give server() consumers the onRequest hook the docs promise (#86)
* Regression tests for an onRequest hook on server()

* Compose the application's onRequest hook into server() past bind

* Document the server's onRequest hook and record the composition decision

* Pin that a re-bind and a pre-bind unbind never reach the hook, and that a non-function hook is refused at startup

* Keep every bind and all pre-bind traffic out of the application's hook

* Make the hook's published promises exact, and record the src layout deferral

* Trim the record to what the tests do not already forbid

* Pin that nothing answers a request whose hook failed

* Answer nothing for a request whose hook failed, on both surfaces alike

* State the hook's failure policy as it now behaves

* Name the request a failed handler left unanswered, and say what a wedged hook reports
2026-09-06 17:20:45 +02:00
lilleman 4194816d6b Document answeredOnArrival for client receivers and onRequest refusal (#85)
* Document answeredOnArrival for client receivers and onRequest refusal

* Apply stability review: correct the onRequest bind claim and teardown order
2026-09-06 06:30:18 +02:00
lilleman 184d1dc7af Read a body from message_payload and accept data_sm (#84)
* Regression tests for a body in message_payload and for data_sm

* Read a body from message_payload and accept data_sm

* Assert the fixed message_payload and data_sm behaviour against Jasmin

* Record the message_payload and data_sm fixes in the Jasmin findings

* Read an inbound data_sm as the direction it travelled, and export messageOctets

* Refuse a segment with the code its stand-in command defines

* Name the stand-in the refusal status is read from
2026-09-06 05:59:27 +02:00
lilleman 5b7b563dc2 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
2026-09-06 04:16:11 +02:00
lilleman db02f0058d Tell a refused PDU apart from a session that failed (#82)
* Regression tests for telling a refused PDU from a failed session

* Export PduRefusedError so a refusal can be told from a session failure

* Document telling a refused PDU from a session failure

* Share the malformed-PDU fixtures and pin that a dead stream is no refusal

* Say once what a refusal is, and why the header type is published

* Fold the refused-response test into the one that already staged it

* Drop the refusal-rate claim the interop finding does not support

* Build a raw PDU one way, sequence number included

* Follow PduRefusedError into pdu-refusal.ts
2026-09-05 23:16:59 +02:00
lilleman afe188eecd Retry the first connect and bind on reconnect fromStart (#80)
* Regression tests for a client that retries its first connect and bind

* Retry the first connect and bind on reconnect: { fromStart: true }

* Pin that the signal bounding the first bind also closes the session

* Name a failed connect once, default the backoff where it lives, and fix the deadline advice

* Carry the failure that started the retries on the abort that ends them

* Pin one retry announcement per attempt when a link drops mid-bind

* Announce a retry when its wait is over, not when it is scheduled

* Say what the process-hold assertion expects, not what a failure would mean
2026-09-05 22:47:06 +02:00
lilleman 45d2f5548e Read a delivery receipt's body as the octets that arrived (#81)
* Regression tests for a receipt body read under a data_coding it is not written in

* Read a delivery receipt's body as the octets that arrived, not by its data_coding

* Assert SMPPSim's UCS2 receipt body parses like every other segment's

* Record the receipt-body defect as fixed

* Retain a multipart segment's octets once, not twice

* Sort the new type import into its file's order
2026-09-05 22:37:05 +02:00
lilleman ea42bc6d20 Refuse a single unreadable PDU instead of the whole link (#79)
* Regression tests: a PDU the codec cannot read costs that PDU, not the link

* Refuse a single unreadable PDU instead of the whole link

* smscsim interop asserts the first attempt gets every DLR

* Record the smscsim sequence number defect as fixed

* One framing rule and one response-command lookup, per the architecture review

* Apply the stability review's nits: honest sessionError docs and one link-survives assertion
2026-09-05 21:00:52 +02:00
lilleman 9ca83ac05c Order the README by what a first read needs, and drop the pre-release notice 2026-09-04 11:59:05 +02:00
lilleman 54493c12b2 Write a transient state as an intermediate delivery notification 2026-09-04 08:38:29 +02:00
lilleman 42e6e97447 Read a receipt reporting a transient state as non-final too, so the merge waits for the real one 2026-09-03 19:28:08 +02:00
lilleman dd458bfa53 Say only what the SMSC marked, and trim the comments the review found redundant 2026-09-03 19:16:13 +02:00
lilleman 50679ec2fe Read an intermediate delivery notification as a report, and keep it out of the merge 2026-09-03 17:30:09 +02:00
lilleman 94184a9c63 Re-wrap the shutdown paragraph and leave the throw-versus-rejection note in one place 2026-09-02 12:40:51 +02:00
lilleman 3eeb0b82c0 Give a message up only once every listener has, and only count a response the wire took 2026-09-02 12:36:01 +02:00
lilleman 3aadb64df8 Release a message's hold when the response goes out, or when its listener failed 2026-09-02 08:15:26 +02:00
lilleman 471923a7b6 Log the dropped request, and scope the receipt sentence to a reconnect 2026-09-01 20:53:58 +02:00
lilleman e6250ef44e Drop a request whose link went while onRequest ran, and pin the wire in the test 2026-09-01 20:40:17 +02:00
lilleman c8d265d5fa Tie the refusal to the link, not to the hold, so a released message is refused too 2026-09-01 20:25:57 +02:00
lilleman 82a95593bd Refuse to answer a message whose link went, instead of reporting it delivered 2026-09-01 19:20:06 +02:00
lilleman f0327044b1 Cover the receipt refusal and the sweep that wakes a drain 2026-09-01 18:13:35 +02:00
lilleman 61985fb914 Say what a peer did with each receipt segment, and leave no drop unlogged 2026-09-01 17:59:37 +02:00
lilleman 67c0402def Bound the messages held for a shutdown, and report a partial receipt 2026-09-01 17:42:22 +02:00
lilleman 1e7e113bd7 Put a receipt's segments on the wire together, like a message's 2026-09-01 17:03:33 +02:00
lilleman 8becbc0ab6 Give the gate, the window and the pending map one owner 2026-09-01 16:52:15 +02:00
lilleman 3bcea108e3 Wait out the messages the application holds before shutting a session down 2026-09-01 13:58:28 +02:00
lilleman 35dd1e7678 Count every request that went out unanswered, and gate a send on a bound link 2026-09-01 10:08:56 +02:00
lilleman 8d9656b4e0 Hold a send with no link for the next one, and count the rest as unanswered 2026-09-01 08:02:37 +02:00
lilleman bfc85ee4dd Say in the options table that a proven link resets the backoff
maxDelay bounds the wait and sets the bar a link must clear, and only the
first was documented, so tuning it up quietly lengthened every recovery.

The unreadable PDU the tests write is one named constant now.
2026-08-31 22:59:57 +02:00
lilleman 8e4d472f72 Back off from a link that dies as soon as it comes up
A bind that returns is not proof the link works: an unreadable stream is
only found afterwards, so resetting the delay there handed a link that
died on arrival a fresh minDelay every cycle — one connect and bind per
second forever, which is how an account gets blocked for bind flooding.
The loop resets only once a link has outlasted maxDelay.

Also covers the unreadable stream that has no loop to retry it.
2026-08-31 22:45:29 +02:00
lilleman b1c790b9a0 Retry a stream we cannot read, and cover the framer reset on attach
A framing or codec error tears the link down rather than the session, so
the loop retries it on a fresh socket with a fresh framer — which is what
a desynced stream needs. Removing that reset failed nothing before; the
reconnect test now leaves half a PDU on the dying link, and does.

`disconnected` counts failed links rather than outages, which the README
now says, and the transport wires its socket as it is built.
2026-08-31 22:27:16 +02:00
lilleman b2d121b4f3 Emit exactly one close, and read the socket through a PduTransport
Ending a session while the link was down emitted nothing: the retried
drop had already torn it down, so close() found nothing left to do. The
terminal event is now guarded by its own flag rather than by `closed`.

The socket, the framer and the parse move to PduTransport, which is what
takes session.ts back under its line cap; `session.sock` reads through a
getter. The backoff also refuses an inverted pair and an unknown key.
2026-08-31 21:53:11 +02:00
lilleman 880454b4f4 Split a retried drop out of close, and range-check the backoff
`close` fires only where nothing will bring the session back; a drop the
reconnect loop will retry is `disconnected`, pairing with `reconnected`.
`minDelay: 0` never doubles, so the backoff never started — both delays
are range-checked now, and only `false` spells reconnect off.
2026-08-31 21:11:19 +02:00
lilleman 18177053bc Re-bind a dropped client link by default, and take false to turn it off
Surviving a drop is most of what the session layer is for, and behind an
opt-in an application that never read the options table got none of it.
`reconnect` still takes `{ minDelay, maxDelay }` to retune the backoff;
`false` is the one spelling for off.
2026-08-31 20:18:29 +02:00
lilleman 706b61d6ca Leave an unknown notation alone and read a receipt's TLV as the id the submit answered 2026-08-30 23:01:39 +02:00
lilleman 696e018b77 Derive the notation names from one table and refuse an smsIdFormat that is not the pair 2026-08-30 22:45:02 +02:00