mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-19 15:06:20 +00:00
25d51aff3f
App.tsx's prepare() useEffect ran four .init() calls (SessionDataManager, RoomSessionManager, RoomEngine, Communication) without any guard, plus an immediate heartbeat ping and a legacy authentication track. Under StrictMode dev double-invoke, those fire twice — risking duplicate session/communication state. - Gate the four .init() chain behind gameInitPromiseRef: both the first and the simulated second invocation await the same promise. - Gate the legacy track + immediate heartbeat behind bootstrapDoneRef. - Heartbeat and remember-rotate intervals were already idempotent (clearInterval before setInterval); ticker registration was already guarded by tickersStartedRef; renderer/warmup were already gated by rendererPromiseRef/warmupPromiseRef. No change needed there. Wrap <App /> in <StrictMode> in src/index.tsx now that the renderer init path is double-invoke safe. https://claude.ai/code/session_01GrR87LAqnAEyKG2ZbmQt5Q