File tree 2 files changed +10
-2
lines changed
packages/database/src/core
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 {
797
797
this . lastConnectionEstablishedTime_ = null ;
798
798
}
799
799
800
- const timeSinceLastConnectAttempt =
801
- new Date ( ) . getTime ( ) - this . lastConnectionAttemptTime_ ;
800
+ const timeSinceLastConnectAttempt = Math . max (
801
+ 0 ,
802
+ new Date ( ) . getTime ( ) - this . lastConnectionAttemptTime_
803
+ ) ;
802
804
let reconnectDelay = Math . max (
803
805
0 ,
804
806
this . reconnectDelay_ - timeSinceLastConnectAttempt
You can’t perform that action at this time.
0 commit comments