From 0ac3544a5c13f9538e5c6bb49251d0f2b214ddaf Mon Sep 17 00:00:00 2001 From: eternal-flame-AD Date: Fri, 15 Nov 2024 05:38:23 -0600 Subject: [PATCH] =?UTF-8?q?Frontend:=20Stream=E5=86=8D=E6=8E=A5=E7=B6=9A?= =?UTF-8?q?=E3=83=AD=E3=82=B8=E3=83=83=E3=82=AFdata=20race=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: eternal-flame-AD --- CHANGELOG.md | 1 + packages/frontend/src/stream.ts | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 232c74eb67..b3adf84fed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - Upstream: 2024.11.0-alpha.1 タッグをマージする - DevOps: 管理者アクセストークンがユーザー登録できるようになる (write:admin:create-account) +- Frontend: Stream再接続ロジックdata raceを修正 - Security: CSPにCDNなどの外部ホストはホワイトリストできるように ## 2024.11.0-yumechinokuni.3 diff --git a/packages/frontend/src/stream.ts b/packages/frontend/src/stream.ts index 57fae49d4b..c3b5a2fb4b 100644 --- a/packages/frontend/src/stream.ts +++ b/packages/frontend/src/stream.ts @@ -38,11 +38,9 @@ function createStream(): Misskey.IStream { console.log('Stream disconnected, attempting to reconnect...'); if (reconnectAttempts < RECONNECT_MAX_ATTEMPTS) { const delay = getReconnectDelay(); - reconnectTimeout = window.setTimeout(() => { - reconnectAttempts++; - stream = null; - useStream(); - }, delay); + reconnectAttempts++; + stream = null; + reconnectTimeout = window.setTimeout(useStream, delay); } else { console.error('Max reconnection attempts reached'); }