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

My safety guard was checked in 6 places. Nothing ever set it.

Описание и применение

Сервер Safari MCP выдавал токены владения вкладками, которые становились недействительными после перезапуска демона, из‑за устаревшего идентификатора сеанса браузера. Это приводило к «застрявшим» вкладкам и отказам команд. Решение – проверять идентификатор сеанса при каждом создании токена и обновлять счётчик генераций.

Задача

Safari MCP server issued tab‑ownership tokens that became invalid after a daemon restart, causing stranded tabs and failed commands.

Результат

The issue was caused by a dead guard that failed to detect epoch rotation during a daemon restart, leading to stale tokens and stranded tabs. The fix involves re‑verifying the epoch at mint time and updating a generation counter.

Рабочий процесс

  • 1. Daemon restarts and extension re‑handshakes. 2. Background worker resolves a browser‑session epoch and caches it. 3. New tokens are minted using the cached epoch. 4. Epoch rotates in session storage during the restart window. 5. Cached epoch remains stale, so new tokens carry old epoch. 6. Later commands using these tokens are rejected, leaving tabs stranded.
  • 7. Rehydration discards all stored tokens with stale epoch, causing simultaneous failures.
  • 8. Bug analysis reveals dead guard that never increments epoch counter.
  • 9. Proposed fix: re‑verify epoch against storage at mint time and increment counter when mismatched.

Доказательства

Tokens are stamped with a browser-session epoch: a random identifier that ties a token to one continuous run of the browser.

Источник

The cached copy is treated as the truth.

Источник

A variable that is compared must be assigned somewhere other than its declaration.

Источник

  • Дата записи: 2026-09-15T22:30:41.159Z