Skip to content

Commit a0033aa

Browse files
authored
Don't swallow emulator hub when version differs (#9068)
1 parent a175544 commit a0033aa

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
- Support auth token JSON in `dataconnect_execute` MPC tool. (#9046)
2+
- Fixed the bugs when MCP tools cannot connect to emulator due to CLI version mis-matched. (#9068)

src/emulator/hub.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { FunctionsEmulator } from "./functionsEmulator";
1212
import { ExpressBasedEmulator } from "./ExpressBasedEmulator";
1313
import { PortName } from "./portUtils";
1414
import { DataConnectEmulator } from "./dataconnectEmulator";
15-
import { isVSCodeExtension } from "../vsCodeUtils";
1615

1716
// We use the CLI version from package.json
1817
const pkg = require("../../package.json");
@@ -53,10 +52,10 @@ export class EmulatorHub extends ExpressBasedEmulator {
5352
const data = fs.readFileSync(locatorPath, "utf8").toString();
5453
const locator = JSON.parse(data) as Locator;
5554

56-
// TODO: In case the locator file format is changed, handle issues with format incompatability
57-
if (!isVSCodeExtension() && locator.version !== this.CLI_VERSION) {
58-
logger.debug(`Found locator with mismatched version, ignoring: ${JSON.stringify(locator)}`);
59-
return undefined;
55+
if (locator.version !== this.CLI_VERSION) {
56+
logger.debug(
57+
`Found emulator locator with different version: ${JSON.stringify(locator)}, CLI_VERSION: ${this.CLI_VERSION}`,
58+
);
6059
}
6160

6261
return locator;

0 commit comments

Comments
 (0)