Repository navigation
Version Packages - #11
Merged
Merged
Conversation
github-actions
Bot
force-pushed
the
changeset-release/master
branch
from
October 6, 2026 12:54
a0f1ccb to
ce43ed4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.
Releases
@semyonf/smpp@1.7.0
Minor Changes
180e698: Add
enquire_linkhandling toSession: answering incomingenquire_link, and dropping the linkwhen an outgoing one is not answered.
Until now an incoming
enquire_linkwas only emitted as an event, andauto_enquire_link_periodsent
enquire_linkwithout ever checking theenquire_link_resp, so a dead link stayed "open"until TCP noticed, which can take many minutes. New options, accepted by both
smpp.connect()andsmpp.createServer():auto_enquire_link_response(defaultfalse) answers every incomingenquire_link.enquire_link_timeoutmakes everyenquire_linksent byauto_enquire_link_periodwait thatmany milliseconds for its response. If none arrives, an
enquire_link_timeoutevent is emittedwith the unanswered
enquire_link, and the session is destroyed unlessclose_on_enquire_link_timeoutisfalse.auto_enquire_link_periodnow also works on server sessions, and stops whensession.close()orsession.destroy()is called instead of firing at a socket that can no longer be written to.After
close()the response to anenquire_linkstill in flight is still awaited, so if thepeer stopped answering and never closes its side, the timeout destroys the session instead of
leaving it half-open.
These
enquire_linkare not subject toresponse_timeout, which is for the requests you sendyourself, and never show up in
'response_timeout'or'response_aborted'events.All of them default to the previous behaviour. At runtime they are controlled with
session.startEnquireLink(period, [timeout]),session.stopEnquireLink()and thesession.autoEnquireLinkResponseproperty.ae37b4a: Add a
response_timeoutoption toconnect()andcreateServer(), so that requests whoseresponse never arrives stop waiting forever.
A request sent with a
responseCallbackused to stay pending until its response arrived, which ona dead or misbehaving connection is never: its callback was never called, a promise wrapped around
it never settled, and it was never cleaned up. With
response_timeout(milliseconds) set, such arequest now fails through its
failureCallbackwith an error whosecodeis'ERESPONSETIMEOUT',and a
'response_timeout'event is emitted with the request pdu, so the timeout is observable evenwithout a
failureCallback. If the session closes first, the requests still waiting fail rightaway, with the code
'ESESSIONCLOSED'(and the socket error, if any, aserr.cause), along with a'response_aborted'event. Each request is reported exactly once, and a response that arrives afterits request timed out is still emitted as a
'pdu'event without calling any callback.The failure callback receives the actual request pdu with its
command_statusleft untouched.Unlike a failed socket write, which still sets
ESME_RSUBMITFAILas before, a missing response doesnot mean that the request was not processed: the peer may have accepted the message and only the
response was lost, so resending it may deliver it twice.
err.codetells the cases apart.The option is disabled by default, and nothing changes for sessions that do not set it: pending
requests are not timed out, and failure callbacks are still only called for requests that could not
be written, as documented so far. Values other than a number between 0 and 2147483647 throw a
RangeError.Patch Changes
180e698: Fix
session.connect(), which could not reconnect a client session: after reconnecting, the sessionsent PDUs but never received one, so every response and incoming request was silently lost.
connect()reused the socket of the previous connection, and a closednet.Socketthat connectsagain never emits
'readable'. Each call now opens a new socket, and also:(which used to corrupt the first PDU of the new connection), the read counters behind the
socket.data.indebug and metrics events, and theclosedstate, soclose(callback)after areconnect waits for the new connection to close. Requests still awaiting a response fail with
ESESSIONCLOSEDwhenresponse_timeoutis set, and are dropped otherwise, as before;connectTimeoutfor every attempt;'error'listener used tobe followed by that connection's
'close', which made the session look closed again;of connecting its socket again, which failed with
EALREADYwhile it was still connecting;ERR_MISSING_ARGS, and leaves thesession untouched when
net.connect()ortls.connect()reject the options.Listeners, options and the
enquire_linkschedule are kept across the reconnect, and reconnectingfrom an
enquire_link_timeoutlistener keeps the new connection instead of havingclose_on_enquire_link_timeoutdestroy it.