Skip to content

Commit 3c10321

Browse files
authored
Merge branch 'master' into hlshen/getInitialData
2 parents c35d745 + 0f10ae3 commit 3c10321

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Fixed issue with prompt when Data Connect prompts user for framework generation.
2+
- Fixed a bug where the Admin SDK fails with ENOTFOUND when automatically connecting to the Data Connect emulator when run in the Functions emulator. (#8379)

src/emulator/env.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,14 @@ export function setEnvVarsForEmulators(
4545
env[Constants.CLOUD_TASKS_EMULATOR_HOST] = host;
4646
break;
4747
case Emulators.DATACONNECT:
48+
// Right now, the JS SDK requires a protocol within the env var.
49+
// https://github.com/firebase/firebase-js-sdk/blob/88a8055808bdbd1c75011a94d11062460027d931/packages/data-connect/src/api/DataConnect.ts#L74
4850
env[Constants.FIREBASE_DATACONNECT_EMULATOR_HOST] = `http://${host}`;
49-
env[Constants.FIREBASE_DATACONNECT_ENV_ALT] = `http://${host}`;
50-
// Originally, there was a typo in this env var name. To avoid breaking folks unecessarily,
51-
// we'll keep setting this.
51+
// The alternative env var, right now only read by the Node.js Admin SDK, does not work if a protocol is appended.
52+
// https://github.com/firebase/firebase-admin-node/blob/a46086b61f58f07426a6ca103e00385ae216691d/src/data-connect/data-connect-api-client-internal.ts#L220
53+
env[Constants.FIREBASE_DATACONNECT_ENV_ALT] = host;
54+
// A previous CLI release set the following env var as well but it is missing an underscore between `DATA` and `CONNECT`.
55+
// We'll keep setting this for customers who depends on this misspelled name. Its value is also kept protocol-less.
5256
env["FIREBASE_DATACONNECT_EMULATOR_HOST"] = host;
5357
}
5458
}

src/init/features/dataconnect/sdk.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ async function askQuestions(setup: Setup, config: Config): Promise<SDKInfo> {
127127
type: "checkbox",
128128
name: "fdcFrameworks",
129129
message:
130-
`Which ${hasFrameworkEnabled && "additional "}frameworks would you like to generate SDKs for? ` +
130+
`Which ${hasFrameworkEnabled ? "additional " : ""}frameworks would you like to generate SDKs for? ` +
131131
"Press Space to select features, then Enter to confirm your choices.",
132132
choices: unusedFrameworks.map((frameworkStr) => ({
133133
value: frameworkStr,

0 commit comments

Comments
 (0)