Build1 distinct publisher3 min readUpdated
Durable admission with a separate event_id and idempotency_key turns an unknown provider outcome into a reconcilable record, and gives auditors evidence without ever storing the token.
The Engineer · Build desk
Compiled by The EngineerSomething wrong?How this is made
A password-reset SMS that times out has not failed; it has returned an unknown outcome, and a dev.to write-up by Liam Foster argues the correct response is to accept the event once, persist its expiry and idempotency key before dispatch, and retry only through a worker that can reconcile the original attempt [1]. That framing matters because for a short-lived e-commerce reset token the deciding constraint is compliance evidence: the system has to show what it accepted, what it attempted, when it stopped and why, without storing the token or the message body in an audit log [2].
Start with the arithmetic of a timeout. Three realities are consistent with it: the provider never accepted the request, it accepted and the response was lost, or it accepted and sent the message before the caller gave up waiting [6]. Two of those three involve a message that may already be on its way, so an immediate blind retry is the right guess in only one case out of three [19]. Retrying as if the first case were certain is exactly how a customer gets two reset messages, and declaring success instead is no better [7]. The durable record should enter dispatch_unknown, keep the provider's attempt identifier when one exists, and pass through reconciliation before any further send is authorized [8].
The identifiers do two different jobs. event_id names the business action, one password-reset request; idempotency_key names the logical notification command [4]. A unique constraint on that key is what makes two concurrent HTTP requests converge on a single stored record, because an in-memory check before the insert can be passed by two processes at the same time [5].
This reshapes the endpoint. An Express handler can receive the event, but it should not hold the request open while the provider decides a final delivery state; return an accepted response after durable admission and expose status from local state [3]. Polling is not retry: it reads the provider's view and updates the local record, and it must not create a second message, a separation that is easy to blur once a generic checkAndRetry() owns both operations [9].
Expiry is a dispatch boundary rather than presentation metadata. Compare the clock to expires_at before every attempt, and once the token is too close to expiry for a useful delivery, mark the notification expired and stop [10]. Foster declines to name a universal safety margin, arguing it should be resolved from your own latency distribution and product policy and then recorded as auditable configuration [11].
The evidence is specific: each transition needs a timestamp, old and new state, event ID, attempt number and reason code, with credentials, the reset URL, the token and the full phone number kept out [13]. A redacted destination fingerprint can support correlation, but it sits under the same retention and authorization controls as the rest of the record [14]. The contract, then, is admission exactly once for a stable event identifier, no dispatch after expiry, retained state transitions, and inspection that does not trigger work; "exactly once" describes admission of the logical command, not a fiction in which the SMS network joins your database transaction [12].
Watch the build decision, because it is a controls question. A managed notification service owns provider reconciliation and channel routing and cuts on-call surface, but its status vocabulary and evidence export may not match what an auditor expects [15]. Direct integration exposes more provider detail and fewer translation layers, and hands your team leases, retry classification, retention and every 02:00 alert [16]. Self-hosting gives the strongest control over data placement and change timing, and is unsuitable when the team cannot staff queue, database and delivery integration as an on-call product [17]. No option wins by default [18].
Follow any of these and your For You feed starts watching them — no settings page required.
Ranked by verification strength, evidence, and original report placement.
Treat an SMS timeout as an unknown outcome rather than a failed send: accept each password-reset event once, persist its expiry and idempotency key before dispatch, and retry only through a worker that can reconcile the original attempt.
A Node.js Express handler may receive the event but should not hold the HTTP request open while an SMS provider decides the final delivery state; return an accepted response after durable admission, then expose status from local state.
Use two identifiers with different jobs: event_id identifies the business action, such as one password-reset request, and idempotency_key identifies the logical notification command.
A unique constraint on the idempotency key makes two concurrent HTTP requests converge on one stored record; checking memory before an insert is not enough because two processes can pass that check together.
A timeout leaves three possible realities: the provider never accepted the request, it accepted the request but the response was lost, or it accepted and sent the message before the caller stopped waiting.
Retrying immediately as though the provider had never accepted the request is how customers receive two reset messages, and declaring success is no better.
Evidence-backed comparisons of source perspectives and observed adoption signals. Read the methodology
Which Builder, Operator, and Investor concerns the observed source mix emphasized—not a truth score.
Evidence, demonstrated adoption, hype gap, incentives, and confidence are assessed independently, each on its own current evidence. How these are measured.
Single-source design argument, internally reasoned
All content comes from one self-published dev.to article with no second source, vendor documentation, standard, or production report. The mechanical core is well reasoned and checkable from first principles (the enumeration of post-timeout states, the concurrency argument for a database unique constraint, the polling-versus-retry hazard), and a partial Go listing shows the intended interfaces. But the listing is truncated before the queue and worker code, and the compliance, retention, and buy-versus-build assertions rest entirely on the author's judgment.
No adoption signal supplied
The cluster contains no release, deployment, benchmark, pricing, licensing, or usage disclosure. The article reports no production system running this pattern, no duplicate-message rate before or after, and no named provider or platform whose uptake could be observed, so no adoption level can be measured without inventing facts.
Mildly overstated prescription, notably self-limited
Slightly positive: the piece issues firm 'must' guidance about auditor expectations, retention controls, and the relative merits of managed, direct, and self-hosted delivery without any measured outcome, deployment, or second source to support generalization. What keeps the gap small is unusual self-limitation: the author scopes 'exactly once' to admission of the logical command and explicitly denies that an external SMS network joins the database transaction, and declines to publish a universal expiry safety margin, saying it may not be defensible and must come from local latency data.
No incentive disclosure available
The supplied material gives no basis to score incentive pressure: no employer, vendor affiliation, sponsorship, product, or commercial relationship is disclosed, and no named provider or platform is promoted or criticized. The buy-versus-build passage is written vendor-neutrally and reaches no default recommendation, so any inference about the author's commercial motivation would be speculation.
Low-moderate: sound mechanics, unverified generalizations, zero adoption data
Confidence is limited by a single publisher, a single item, a truncated code sample, and no adoption or incentive evidence whatsoever. It is not lower because the load-bearing engineering claims are deductively checkable and mutually consistent, the state machine and identifier split are specified precisely enough to implement, and the author flags the limits of the weakest parts.
build
Your JWT Login Probably Has Exactly One Kill Switch: Log Everyone Out1 distinct publisher
build
OpenAI-compatible image APIs normalize transport, not fallback routing1 distinct publisher
build
Fuse ranks, not scores: a retrieval contract that refuses to guess in code review1 distinct publisher
build
A webhook that only verifies, claims and acks is the cheapest way to make delayed work safe1 distinct publisher
Distinct publishers with included, body-backed reporting in this cluster.
dev.to
1 article · August 17, 2026