File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
packages/database/src/core Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @firebase/database " : patch
3+ ' firebase ' : patch
4+ ---
5+
6+ Fix a potential for a negative offset when calculating last reconnect times. This could cause lengthy reconnect delays in some scenarios. Fixes #8718 .
Original file line number Diff line number Diff line change @@ -797,8 +797,10 @@ export class PersistentConnection extends ServerActions {
797797 this . lastConnectionEstablishedTime_ = null ;
798798 }
799799
800- const timeSinceLastConnectAttempt =
801- new Date ( ) . getTime ( ) - this . lastConnectionAttemptTime_ ;
800+ const timeSinceLastConnectAttempt = Math . max (
801+ 0 ,
802+ new Date ( ) . getTime ( ) - this . lastConnectionAttemptTime_
803+ ) ;
802804 let reconnectDelay = Math . max (
803805 0 ,
804806 this . reconnectDelay_ - timeSinceLastConnectAttempt
You can’t perform that action at this time.
0 commit comments