Conversation state becomes stale when a caller corrects a detail or another actor changes the underlying record. Attach version information to actions so an older understanding cannot silently overwrite the current one.
Freshness has two separate dimensions
Conversation freshness concerns whether the action reflects the caller’s latest confirmed intent. Resource freshness concerns whether the business record still matches the version used to prepare the action. Checking one does not establish the other.
In a proposed design, each intent revision and relevant record version travels with the operation. Before execution, the service verifies that the intent is still current and applies the authoritative system’s supported concurrency check. If either comparison fails, return a conflict that the conversation can resolve.
Do not depend on timestamps alone when the system supports stronger version identifiers. Clocks can differ and simultaneous changes may share coarse timestamps. Define exactly which fields a version protects.
Follow a fictional correction race
A caller initially gives 18 Lake Street, then corrects it to 80 Lake Street. A slow lookup for the first address returns after the correction. The application should discard or mark that lookup stale rather than overwrite the confirmed address with the older result.
Meanwhile, staff add an access instruction to the existing service request. A subsequent agent update should preserve that newer staff change unless the operation explicitly and authoritatively replaces it. Sending an entire stale record back can erase fields the caller never discussed.
| Race condition | Required behaviour |
|---|---|
| Old lookup returns after correction | Do not replace current intent |
| Staff updates the same record | Detect conflict or apply a safe field-level operation |
| Queued job runs after call revision | Reject superseded action |
| Retry uses old payload | Reconcile the operation rather than invent a new write |
| Session reconnects | Restore the current revision, not a cached draft |
Use controlled delays to reproduce these races. A fast local integration can pass repeatedly while never exercising the out-of-order response that causes the production defect.
Conflicts should lead to a precise recovery
A conflict does not always require starting the conversation again. Reload the affected state, preserve unrelated confirmed details, and ask only about the changed information. For a consequential action, obtain fresh confirmation if its meaning changed.
Version checks add rejection paths and can increase clarification. That tradeoff protects newer caller and staff decisions. Monitor conflict rates to distinguish healthy protection from an integration that needlessly writes whole records.
This is a proposed concurrency design. The HVAC request case study shows a relevant staff workflow. Compare pending-action cancellation for operations already underway.
Stale-state FAQ
Does the latest arriving response contain the latest facts?
No. Arrival order and source revision can differ.
Is checking the caller’s latest intent enough?
No. Another employee or system may have changed the target record independently.
Should stale actions be retried automatically?
Only after reconciling the new state and ensuring that the operation still matches the caller’s authorised intent.