From fe7da7ec3c83c200d7a0c7b90bb6bd27654309ee Mon Sep 17 00:00:00 2001 From: Ehsan Date: Tue, 6 Jun 2023 09:51:45 -0700 Subject: [PATCH] Fix potentially false warning message. (#7339) * Fix potentially false warning message. Fixes #7331. * Create giant-bees-clean.md --- .changeset/giant-bees-clean.md | 5 +++++ packages/firestore/src/lite-api/database.ts | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 .changeset/giant-bees-clean.md diff --git a/.changeset/giant-bees-clean.md b/.changeset/giant-bees-clean.md new file mode 100644 index 00000000000..460e6b40d02 --- /dev/null +++ b/.changeset/giant-bees-clean.md @@ -0,0 +1,5 @@ +--- +"@firebase/firestore": patch +--- + +Fix potentially false warning message. diff --git a/packages/firestore/src/lite-api/database.ts b/packages/firestore/src/lite-api/database.ts index 848973873f1..22764282551 100644 --- a/packages/firestore/src/lite-api/database.ts +++ b/packages/firestore/src/lite-api/database.ts @@ -301,17 +301,18 @@ export function connectFirestoreEmulator( ): void { firestore = cast(firestore, Firestore); const settings = firestore._getSettings(); + const newHostSetting = `${host}:${port}`; - if (settings.host !== DEFAULT_HOST && settings.host !== host) { + if (settings.host !== DEFAULT_HOST && settings.host !== newHostSetting) { logWarn( - 'Host has been set in both settings() and useEmulator(), emulator host ' + - 'will be used' + 'Host has been set in both settings() and connectFirestoreEmulator(), emulator host ' + + 'will be used.' ); } firestore._setSettings({ ...settings, - host: `${host}:${port}`, + host: newHostSetting, ssl: false });