@@ -27,7 +27,7 @@ import { Provider } from '@firebase/component';
27
27
import {
28
28
getModularInstance ,
29
29
createMockUserToken ,
30
- deepEqual ,
30
+ // deepEqual, DEDB replace
31
31
EmulatorMockTokenOptions ,
32
32
getDefaultEmulatorHostnameAndPort
33
33
} from '@firebase/util' ;
@@ -86,10 +86,12 @@ let useRestClient = false;
86
86
function repoManagerApplyEmulatorSettings (
87
87
repo : Repo ,
88
88
host : string ,
89
+ port : number , // DEDB remove
89
90
tokenProvider ?: AuthTokenProvider
90
91
) : void {
91
92
repo . repoInfo_ = new RepoInfo (
92
- host ,
93
+ //host, DDB replace
94
+ `${ host } :${ port } ` , // DEDB remove
93
95
/* secure= */ false ,
94
96
repo . repoInfo_ . namespace ,
95
97
repo . repoInfo_ . webSocketOnly ,
@@ -352,11 +354,12 @@ export function connectDatabaseEmulator(
352
354
db . _checkNotDeleted ( 'useEmulator' ) ;
353
355
const hostAndPort = `${ host } :${ port } ` ;
354
356
const repo = db . _repoInternal ;
357
+ /*
355
358
if (db._instanceStarted) {
356
359
// If the instance has already been started, then silenty fail if this function is called again
357
360
// with the same parameters. If the parameters differ then assert.
358
361
if (
359
- hostAndPort === repo . repoInfo_ . host &&
362
+ hostAndPort === db._repoInternal .repoInfo_.host &&
360
363
deepEqual(options, repo.repoInfo_.emulatorOptions)
361
364
) {
362
365
return;
@@ -365,6 +368,7 @@ export function connectDatabaseEmulator(
365
368
'connectDatabaseEmulator() cannot alter the emulator configuration after the database instance has started.'
366
369
);
367
370
}
371
+ */
368
372
369
373
let tokenProvider : EmulatorTokenProvider | undefined = undefined ;
370
374
if ( repo . repoInfo_ . nodeAdmin ) {
@@ -383,7 +387,9 @@ export function connectDatabaseEmulator(
383
387
}
384
388
385
389
// Modify the repo to apply emulator settings
386
- repoManagerApplyEmulatorSettings ( repo , hostAndPort , tokenProvider ) ;
390
+ //repoManagerApplyEmulatorSettings(repo, hostAndPort, tokenProvider); // DDB Replace
391
+ repoManagerApplyEmulatorSettings ( repo , host , port , tokenProvider ) ; // DDB Remove
392
+
387
393
}
388
394
389
395
/**
0 commit comments