Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Seller Notifications: Email and SMS Timeout Handling With Polling Acceptance Tests

A marketplace seller needs email or SMS notifications about a new order event. After a submission timeout, with no webhook receiver, the useful constraint is evidence: does the worker have a message identifier it can query, or just an unanswered request? TL;DR: Keep an order notification record, separate submission from delivery, and let a scheduled worker reconcile known message identifiers. A…

When a marketplace seller waits for an email or SMS notification about a new order event, there is a risk of timeout if the remote system does not respond. The key is to keep track of the order notification record, separate the submission from the delivery, and use a scheduled worker to reconcile known message identifiers. To handle email and SMS notifications after a timeout, the worker should first examine the order and seller information, such as order-1042 and seller-27.

If the notification policy calls for both channels, the SMS should be recorded separately from the email to maintain clarity.

The first design constraint is the submission boundary, where a deadline expiring in the caller does not confirm whether the remote system accepted the request. This uncertainty should be represented explicitly. If a response contains a message identifier, it should be persisted, and a status lookup scheduled. However, if no identifier is available, the worker must have an integration-specific method to find the submission or decide on an explicit resolution. Polling an invented identifier is not a solution and should be avoided.

The worker should retain evidence, including the order reference, channel, local notification key, remote message identifier, and the last observed status. It is crucial to differentiate between a submission acknowledgement and evidence of delivery, preserving an unknown outcome when the evidence does not support a stronger statement. For SMS, refer to the documentation in References to verify the actual status contract of the integration, as email and SMS adapters may have different contracts.

The second trap to avoid is automatically sending SMS when an email request times out, which can turn a transport ambiguity into a seller communication policy. The fallback should be an explicit policy with its own record, rather than hiding it inside exception handling. Although this adds some application logic, it helps maintain control over how often to interrupt a seller.

To build the reconciliation core, create a state transition that can be exercised without credentials or a running scheduler. The caller must persist the remote identifier when it receives one. A record with no identifier enters the review path, as this example does not have a universal lookup-by-order API. All interfaces below are application-owned contracts and not commercial API routes or claims about a provider's response format.

The minimum useful implementation includes a state transition that can be tested without credentials or a running scheduler. Submission happens outside this function, with the caller persisting the remote identifier when received. The record with no identifier enters the review path, and the adapter must translate documented remote states into outcomes like "pending," "delivered," or "failed." An ambiguous result should be left as "pending."

The function `reconcile` takes a `Notice`, a `StatusPort`, the current time (`now`), and a `pollDelayMs` as inputs and returns a proposed `Notice` record. If the state is not "pending," it returns the notice as is. If there is no remote identifier or the current time exceeds `stopPollingAt`, it returns the notice with the state set to "needs-review."

If a next poll time is set, it checks if the current time has passed that time before proceeding. The function attempts to read the remote identifier and sets the outcome accordingly. If the lookup fails, it sets the outcome to "pending."

The worker must claim a due record, call the `reconcile` function, and save the result using a lease or version check to prevent overlapping executions from overwriting newer evidence. Remote lookup should have a bounded time, as polling delay does not impose a network deadline. Finally, submission deduplication must be built separately from a stable key for the order, seller, channel, and notification purpose, while remote deduplication after ambiguous submissions must be verified in the chosen sending contract before allowing automatic resubmission.

Avoid expanding config files, keeping polling delay and observation deadline as inputs passed by the caller, and ensuring the core remains focused on the unresolved path before adding a scheduler.

Rewritten by urgent.news; may contain errors — check the original. How we use AI.

Source: dev.to

Read the original at dev.to →

More from Dev.to on urgent.news

Get the news by email. Yesterday's most-covered stories, every morning.

We track opens and clicks to improve the newsletter.

See today's edition · More options

More in Tech

Web Audio Cues & Ghost Previews in a Connect 4 Game

I built this tutorial around a single-file GridDrop Connect 4 browser game prompt so you can go from an empty editor to a working tabletop match without setting up bundlers, frameworks, or external…

  • Connect 4 browser game built in single index.html file
  • Features audio cues, AI modes, and accessibility
  • Deployable on GitHub Pages, Netlify, or Vercel

Your PLC Doesn't Care About Your Event Loop

Four lessons from putting asyncio on the factory floor At some point, almost every automation team picks up Python. It rarely starts as a big decision.

  • Round-trips to PLCs are costly; batch requests to reduce latency.
  • Async ADS clients can block event loops if decoding large responses improperly.
  • Separate protocol (ADS) from transport (TCP/MQTT) for easier network changes.

Schema Markup That Still Matters in 2026

The schema markup that still matters in 2026 is the markup that describes your entity and your page accurately: Organization or LocalBusiness on the business itself, WebSite and WebPage for structure…

  • Schema markup remains relevant in 2026 for accurate entity and page description.
  • Google emphasizes structured data doesn't guarantee rich results or better rankings.

How Group Jam keeps everyone in sync without streaming a single byte of audio

Group Jam lets a few friends listen to the same song at the same moment, each on their own phone or desktop. A common first question is "so you stream the audio through your servers?" No. The room…

  • Group Jam synchronizes playback without streaming audio
  • Shared clock and playback anchor keep devices in sync
  • Sync loop corrects drift between room and local player

More from Sunday, 6 December 2026 →