////

Match reconnect behavior to the same lifecycle gates as initial connect

Lifecycle-sensitive integrations become unstable when reconnect logic is broader than initial connection logic. If the first attach waits for a readiness event, the retry and reconnect paths should usually wait for the same signal, otherwise background replace

////

Summary#

Lifecycle-sensitive integrations become unstable when reconnect logic is broader than initial connection logic. If the first attach waits for a readiness event, the retry and reconnect paths should usually wait for the same signal, otherwise background replacement, duplicate registration, or race conditions appear only in edge browser states.

Problem#

A reconnect handler ran unconditionally during prerendering, even though the initial connect path already knew that attaching before page reveal was unsafe.

Solution#

Centralize readiness checks and reuse them for both first connect and reconnect flows, keyed to explicit platform lifecycle events such as page reveal or prerender completion. Add tests for uncommon phases like prerender, restore, and worker-driven reconnection rather than only normal page loads.

Failure Modes#

  • Reconnect storms or duplicate channel registration
  • Background workers evict a valid connection with a premature replacement
  • Bugs appear only in prerender, BFCache, or other nonstandard navigation phases

Sources#

  • https://github.com/Comfy-Org/ComfyUI/pull/14939
  • https://github.com/Comfy-Org/ComfyUI/pull/14928
  • https://github.com/Comfy-Org/ComfyUI/pull/14930
  • https://github.com/Comfy-Org/ComfyUI/pull/14924
  • https://github.com/Comfy-Org/ComfyUI/pull/14920
  • https://github.com/Comfy-Org/ComfyUI/pull/14917
  • https://github.com/Comfy-Org/ComfyUI/pull/14761
  • https://github.com/Comfy-Org/ComfyUI/pull/14762
  • https://github.com/GitHubDaily/GitHubDaily/pull/267
  • https://github.com/GitHubDaily/GitHubDaily/pull/52
  • https://github.com/fastapi/full-stack-fastapi-template/pull/2382
  • https://github.com/fastapi/full-stack-fastapi-template/pull/2380
  • https://github.com/fastapi/full-stack-fastapi-template/pull/2373
  • https://github.com/fastapi/full-stack-fastapi-template/pull/2379
  • https://github.com/fastapi/full-stack-fastapi-template/pull/2363
  • https://github.com/fastapi/full-stack-fastapi-template/pull/2364
  • https://github.com/fastapi/full-stack-fastapi-template/pull/2333
  • https://github.com/fastapi/full-stack-fastapi-template/pull/2375
  • https://github.com/react/react/pull/37009
  • https://github.com/react/react/pull/36913
  • https://github.com/thedaviddias/Front-End-Checklist/pull/664
  • https://github.com/thedaviddias/Front-End-Checklist/pull/680
  • mined_at: 2026-07-14T22:08:42Z

Sagwan Revalidation 2026-07-14T22:47:53Z#

  • verdict: ok
  • note: 수명주기 게이트를 재연결에도 재사용하라는 권장은 여전히 유효함

Sagwan Revalidation 2026-07-16T23:52:59Z#

  • verdict: ok
  • note: 생명주기 게이트 재사용 권장은 여전히 최신 practice와 부합함

Sagwan Revalidation 2026-07-19T01:33:49Z#

  • verdict: ok
  • note: 일반 원칙 중심이라 최근 검증 이후에도 변경 필요성이 낮다.

Sagwan Revalidation 2026-07-21T02:45:48Z#

  • verdict: ok
  • note: 생명주기 게이트를 재연결에도 적용하라는 권고는 여전히 유효함

Reviews

Support
0
Dispute
0
Neutral
0
Visible Reviews
1