WeThaiInvest / The architecture of an interruption
Before the message,
a decision.
An article, an announcement, a price alert. Each starts with something worth saying. The harder work is deciding who should hear it, where it belongs and when it is too late to help.
Something happened.
That does not yet mean
we should interrupt.
01 / REMEMBER THE INTENT
The message begins
before the send button.
An article is published. An administrator has an update. A price condition is met. Each event can produce something worth communicating, but the source event and the act of contacting someone are different responsibilities.
If a business operation commits and the process stops before requesting delivery, a message can disappear in the gap. Sending first creates the opposite problem: the message may describe something the application never successfully committed.
The outbox makes that handoff durable. A producer records notification intent inside its transaction. After the commit, a queue can help wake the next worker quickly. If that wake-up is unavailable, the database record remains the place from which processing can recover.
I like the clarity of that division. The source decides what happened. The notification platform decides how to carry the intent forward. A transport helps move work; it does not become the only memory that the work exists.
Someone was eligible.
Are they still?
Try changing the situation around an ordinary, optional message.
Same message. Different decisions.
Eligible for this channel
Eligible for this channel
Eligible for this channel
An eligible channel can proceed. Eligibility is not proof of delivery or reading.
A notification may wait while the world around it changes. An account becomes inactive. A person switches off a channel. A subscription is no longer available. A message that was useful when created may reach its deadline before a worker attempts delivery.
That is why the recipient policy is checked at more than one point. Fan-out determines the work that should exist. The delivery path evaluates the recipient and deadline again, close to the external side effect. For group messages, continued membership also matters at send time.
Preferences are not an inconvenience around the main feature. They are part of its meaning. Choosing a category or channel tells the system which interruptions are welcome. Quiet hours can defer an external message; they do not make an in-app reading surface disappear.
Some policies have deliberate exceptions. The platform distinguishes ordinary preferences from mandatory messages and special critical-priority behavior. Those exceptions need their own reasons; they should not become a shortcut for treating every update as urgent.
A place to return to.
A tap on the shoulder.
A message in a conversation.
There when you return.
The notification centre is a reading surface inside the product. It gives a message a place to live alongside the task it concerns. Eligibility and reading state belong here; an external provider accepting a send is not what makes the message available.
A short invitation.
A push message has a smaller canvas and depends on an available subscription. Its useful job is often to tell someone what changed and offer a clear way back. Delivery work can have several device targets, each with its own outcome.
Part of another space.
A Telegram message enters a conversation the person already uses. Account linking, notification preferences and provider behavior all affect that path. The same event needs wording that works in this context, not just a copy of an in-app card.
These destinations share an underlying event, but they do not share a single outcome. A person may be eligible for the in-app message while an external channel is disabled or unavailable. Counting everything as “sent” would hide precisely the differences needed to explain what happened.
The fan-out path creates external work in bounded batches and advances its cursor with the committed work. That makes progress resumable without requiring one enormous operation over the entire audience. Each external delivery has its own identity, state and deadline.
Recovery needs a deadline.
A retry can turn a temporary failure into a successful delivery. It can also turn yesterday’s useful message into today’s unnecessary interruption. The difference depends on what the message is for and how much of its useful life remains.
The delivery path uses backoff, takes provider retry instructions into account and checks the deadline before scheduling another attempt. Deferral has the same boundary: if quiet hours would end after the message expires, waiting no longer serves the message’s purpose.
Expiry and deletion are related but different. The deadline determines whether work is still eligible. Retention controls how long records remain. A record waiting for cleanup must not become permission to deliver stale information.
There is also a limit to what the platform can know. A provider may accept a request while its response is lost. Internal deduplication and ownership checks reduce repeated work, but they do not turn an external network into a perfect receipt of human attention. A reliable story should leave that uncertainty visible.
What I want from the system is an explanation for its choices. Was the recipient inactive? Was the channel unavailable? Was the work deferred, expired or attempted? Those answers are more useful than a single growing counter—and more respectful than sending again simply because a worker can.
Sometimes the correctRead the event that starts the journeyThe price moved. The moment stayed.
delivery outcome is
quiet.
Related work & references
Selected public entry points and related portfolio pages. A company website or profile is context, not a claim that private source code is available.
Scope, context & further questions
Based on the notification policy, outbox, fan-out, retention and delivery implementation reviewed on 1 October 2026. The interactive example covers an ordinary optional message. Mandatory policy, special critical-priority rules and provider failures are outside that simplified example.
- Durability: Outbox. Committed records remain recoverable if the queue wake-up is unavailable.
- Eligibility: Rechecked. Active state, audience, preferences and delivery deadlines are evaluated close to external delivery.
- Channels: Separate outcomes. External delivery records have independent status, attempts and deadlines; in-app availability follows its own policy.
Questions I am still working through
Why check recipient policy again after a delivery has been queued?
Eligibility can change while work waits. The delivery path needs current account state, channel availability, preferences and a still-valid deadline before attempting the external side effect.
The remaining race between the last check and an external request cannot be erased by wording alone; the boundary must stay explicit.
Is an expired message immediately deleted everywhere?
Expiry stops work from remaining eligible; retention determines how long records stay. Cleanup timing and external copies are separate concerns. The system should not infer permission to send from the fact that a record still exists.
Choosing useful retention periods requires balancing support context, privacy and the purpose of each message type.