Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

One Timeout Cannot Answer Two Questions: Why an AI Write's Confirmation Needs Two Windows

说明与用途

单一超时无法回答两个问题:等待确认的时长和行是否仍可决定。通过将超时拆分为两个窗口并使用原子条件更新,系统确保行要么可操作,要么已过期,但不会同时出现。

问题

A single timeout value was used to answer two distinct questions—whether the UI should keep waiting and whether a row can still be decided—leading to inconsistent behavior where pending rows appeared actionable but were already expired, causing click failures.

结果

The refactored timeout logic eliminates inconsistent UI states and prevents duplicate executions, ensuring that a pending row is either actionable or expired, but never both.

工作流

  • 1. Identify that one timeout value is used for two different purposes.
  • 2. Split the timeout into two windows: 60 s in-conversation wait and 24 h offline window.
  • 3. Refactor boundary calculations so each window is computed by a single function used by both read and sweep paths.
  • 4. Replace non-atomic decision logic with a conditional database update that checks the row is still pending.
  • 5. Ensure the in-memory wait is only released after the decision has been successfully persisted.
  • 6. Update documentation and result messages to clarify that only one decision is guaranteed, not one execution.

证据

We used one timeout to answer both. What that produced was a list showing "waiting on you" for a row where clicking was guaranteed to fail.

来源

The offline window's boundary was computed twice: the read path compared timestamps in memory, and the maintenance sweep compared them in SQL.

来源

Second, every boundary is computed by exactly one function.

来源

What we do is a conditional update in the database, where the condition includes "the current status is still pending".

来源

  • 记录日期: 2026-10-19T01:56:11.515Z