File tree 3 files changed +13
-9
lines changed
3 files changed +13
-9
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @firebase/database " : patch
3
+ ---
4
+
5
+ Fixes a regression introduced with 8.4.1 that broke ` useEmulator() ` .
Original file line number Diff line number Diff line change @@ -773,7 +773,6 @@ export class PersistentConnection extends ServerActions {
773
773
const onReady = this . onReady_ . bind ( this ) ;
774
774
const onDisconnect = this . onRealtimeDisconnect_ . bind ( this ) ;
775
775
const connId = this . id + ':' + PersistentConnection . nextConnectionId_ ++ ;
776
- const self = this ;
777
776
const lastSessionId = this . lastSessionId ;
778
777
let canceled = false ;
779
778
let connection : Connection | null = null ;
@@ -807,17 +806,17 @@ export class PersistentConnection extends ServerActions {
807
806
. then ( result => {
808
807
if ( ! canceled ) {
809
808
log ( 'getToken() completed. Creating connection.' ) ;
810
- self . authToken_ = result && result . accessToken ;
809
+ this . authToken_ = result && result . accessToken ;
811
810
connection = new Connection (
812
811
connId ,
813
- self . repoInfo_ ,
814
- self . applicationId_ ,
812
+ this . repoInfo_ ,
813
+ this . applicationId_ ,
815
814
onDataMessage ,
816
815
onReady ,
817
816
onDisconnect ,
818
817
/* onKill= */ reason => {
819
- warn ( reason + ' (' + self . repoInfo_ . toString ( ) + ')' ) ;
820
- self . interrupt ( SERVER_KILL_INTERRUPT_REASON ) ;
818
+ warn ( reason + ' (' + this . repoInfo_ . toString ( ) + ')' ) ;
819
+ this . interrupt ( SERVER_KILL_INTERRUPT_REASON ) ;
821
820
} ,
822
821
lastSessionId
823
822
) ;
@@ -826,7 +825,7 @@ export class PersistentConnection extends ServerActions {
826
825
}
827
826
} )
828
827
. then ( null , error => {
829
- self . log_ ( 'Failed to get token: ' + error ) ;
828
+ this . log_ ( 'Failed to get token: ' + error ) ;
830
829
if ( ! canceled ) {
831
830
if ( this . repoInfo_ . nodeAdmin ) {
832
831
// This may be a critical error for the Admin Node.js SDK, so log a warning.
Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ export class FirebaseDatabase implements _FirebaseService {
217
217
218
218
/** @hideconstructor */
219
219
constructor (
220
- private _repoInternal : Repo ,
220
+ public _repoInternal : Repo ,
221
221
/** The FirebaseApp associated with this Realtime Database instance. */
222
222
readonly app : FirebaseApp
223
223
) { }
@@ -300,7 +300,7 @@ export function useDatabaseEmulator(
300
300
) ;
301
301
}
302
302
// Modify the repo to apply emulator settings
303
- repoManagerApplyEmulatorSettings ( db . _repo , host , port ) ;
303
+ repoManagerApplyEmulatorSettings ( db . _repoInternal , host , port ) ;
304
304
}
305
305
306
306
/**
You can’t perform that action at this time.
0 commit comments