Skip to content

Commit 0b3bf10

Browse files
authored
Merge branch 'main' into leoortizz_nextjsproxyfixes
2 parents 64501f1 + 958949e commit 0b3bf10

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+3472
-2354
lines changed

.github/workflows/node-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ jobs:
270270
# - npm run test:storage-emulator-integration
271271
# - npm run test:dataconnect-deploy # TODO (joehanley): Reenable this - it should be safe to run in parallel
272272
# - npm run test:dataconnect-emulator # TODO (joehanley): Figure out why this is failing
273-
- npm run test:frameworks
273+
# - npm run test:frameworks
274274
steps:
275275
- name: Setup Java JDK
276276
uses: actions/setup-java@v3.3.0

firebase-vscode/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## NEXT
22

3+
- Fix the data connect emulator discovery bugs.
4+
35
## 2.0.0
46

57
- Update internal `firebase-tools` dependency to 15.0.0

firebase-vscode/src/core/emulators.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ export class EmulatorsController implements Disposable {
2121

2222
// called by emulator UI
2323
this.subscriptions.push(
24-
broker.on("runStartEmulators", () => {
25-
this.setEmulatorsStarting();
24+
broker.on("runStartEmulators", async () => {
25+
if (await this.areEmulatorsRunning()) {
26+
return;
27+
}
28+
this.startEmulators();
2629
}),
2730
);
2831

@@ -143,6 +146,12 @@ export class EmulatorsController implements Disposable {
143146
this.notifyEmulatorStateChanged();
144147
}
145148

149+
public async areEmulatorsRunning(): Promise<boolean> {
150+
// Check if any emulators are running
151+
// It may have been terminated without VS Code knowing.
152+
return (await this.findRunningCliEmulators())?.status === "running";
153+
}
154+
146155
async findRunningCliEmulators(): Promise<
147156
{ status: EmulatorsStatus; infos?: RunningEmulatorInfo }
148157
> {
@@ -188,13 +197,6 @@ export class EmulatorsController implements Disposable {
188197
}
189198
}
190199

191-
public async areEmulatorsRunning(): Promise<boolean> {
192-
if (this.emulators.status === "running") {
193-
return true;
194-
}
195-
return (await this.findRunningCliEmulators())?.status === "running";
196-
}
197-
198200
/** FDC specific functions */
199201
readonly isPostgresEnabled = signal(false);
200202
private connectToEmulatorStream() {

firebase-vscode/src/data-connect/terminal.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { checkLogin } from "../core/user";
44
import { DATA_CONNECT_EVENT_NAME, AnalyticsLogger } from "../analytics";
55
import { getSettings } from "../utils/settings";
66
import { currentProjectId } from "../core/project";
7+
import { EmulatorHub } from "../../../src/emulator/hub";
78

89
let environmentVariables: Record<string, string> = {};
910

@@ -93,9 +94,7 @@ export function registerTerminalTasks(
9394
analyticsLogger.logger.logUsage(DATA_CONNECT_EVENT_NAME.START_EMULATORS);
9495

9596
let cmd = `${settings.firebasePath} emulators:start`;
96-
if (currentProjectId.value) {
97-
cmd += ` --project ${currentProjectId.value}`;
98-
}
97+
cmd += ` --project ${currentProjectId.value || EmulatorHub.MISSING_PROJECT_PLACEHOLDER}`;
9998
if (settings.importPath) {
10099
cmd += ` --import ${settings.importPath}`;
101100
}
@@ -108,17 +107,13 @@ export function registerTerminalTasks(
108107
{ focus: true },
109108
);
110109
};
111-
const startEmulatorsTaskBroker = broker.on("runStartEmulators", () => {
112-
startEmulatorsTask();
113-
});
114110
const startEmulatorsCommand = vscode.commands.registerCommand(
115111
"firebase.emulators.start",
116112
startEmulatorsTask,
117113
);
118114

119115
return Disposable.from(
120116
{ dispose: loginTaskBroker },
121-
{ dispose: startEmulatorsTaskBroker },
122117
startEmulatorsCommand,
123118
vscode.commands.registerCommand(
124119
"firebase.dataConnect.runTerminalTask",

firebase-vscode/webviews/data-connect/data-connect.entry.tsx

Lines changed: 0 additions & 85 deletions
This file was deleted.

0 commit comments

Comments
 (0)