Skip to content

Commit cc88d96

Browse files
Added CHANGELOG entry
Co-authored-by: fredzqm <9068391+fredzqm@users.noreply.github.com>
1 parent cbfd188 commit cc88d96

3 files changed

Lines changed: 41 additions & 44 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
- Fixed an issue where functions deployments would silently fail (#6989)
1+
- Renamed Data Connect displayed text to SQL Connect

src/command.ts

Lines changed: 39 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { getProject } from "./management/projects";
1515
import { reconcileStudioFirebaseProject } from "./management/studio";
1616
import { requireAuth } from "./requireAuth";
1717
import { Options } from "./options";
18-
import { logger, useConsoleLoggers } from "./logger";
18+
import { useConsoleLoggers } from "./logger";
1919
import { isFirebaseStudio } from "./env";
2020

2121
export interface CommandModule {
@@ -236,28 +236,28 @@ export class Command {
236236
});
237237
}
238238
const duration = Math.floor((process.uptime() - start) * 1000);
239-
try {
240-
const trackSuccess = trackGA4(
241-
"command_execution",
242-
{
243-
command_name: this.name,
244-
result: "success",
245-
interactive: getInheritedOption(options, "nonInteractive") ? "false" : "true",
246-
},
247-
duration,
248-
);
249-
const tracks = [trackSuccess];
250-
if (isEmulator) {
251-
tracks.push(
239+
const trackSuccess = trackGA4(
240+
"command_execution",
241+
{
242+
command_name: this.name,
243+
result: "success",
244+
interactive: getInheritedOption(options, "nonInteractive") ? "false" : "true",
245+
},
246+
duration,
247+
);
248+
if (!isEmulator) {
249+
await withTimeout(5000, trackSuccess);
250+
} else {
251+
await withTimeout(
252+
5000,
253+
Promise.all([
254+
trackSuccess,
252255
trackEmulator("command_success", {
253256
command_name: this.name,
254257
duration,
255258
}),
256-
);
257-
}
258-
await withTimeout(1000, Promise.all(tracks));
259-
} catch (gaErr) {
260-
logger.debug("Analytics tracking failed during success path:", gaErr);
259+
]),
260+
);
261261
}
262262
process.exit();
263263
})
@@ -278,30 +278,27 @@ export class Command {
278278
});
279279
}
280280
const duration = Math.floor((process.uptime() - start) * 1000);
281-
try {
282-
const trackError = trackGA4(
283-
"command_execution",
284-
{
285-
command_name: this.name,
286-
result: "error",
287-
interactive: getInheritedOption(options, "nonInteractive") ? "false" : "true",
288-
},
289-
duration,
290-
);
291-
const tracks = [trackError];
292-
if (isEmulator) {
293-
tracks.push(
294-
trackEmulator("command_error", {
281+
await withTimeout(
282+
5000,
283+
Promise.all([
284+
trackGA4(
285+
"command_execution",
286+
{
295287
command_name: this.name,
296-
duration,
297-
error_type: err?.exit === 1 ? "user" : "unexpected",
298-
}),
299-
);
300-
}
301-
await withTimeout(1000, Promise.all(tracks));
302-
} catch (gaErr) {
303-
logger.debug("Analytics tracking failed during error path:", gaErr);
304-
}
288+
result: "error",
289+
interactive: getInheritedOption(options, "nonInteractive") ? "false" : "true",
290+
},
291+
duration,
292+
),
293+
isEmulator
294+
? trackEmulator("command_error", {
295+
command_name: this.name,
296+
duration,
297+
error_type: err.exit === 1 ? "user" : "unexpected",
298+
})
299+
: Promise.resolve(),
300+
]),
301+
);
305302

306303
client.errorOut(err);
307304
});

src/emulator/dataconnectEmulator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ export class DataConnectEmulator implements EmulatorInstance {
285285
const res = childProcess.spawnSync(commandInfo.binary, cmd, { encoding: "utf-8", env });
286286
if (isIncomaptibleArchError(res.error)) {
287287
throw new FirebaseError(
288-
`Unknown system error when running the SQL Connect toolkit. ` +
288+
`Unkown system error when running the SQL Connect toolkit. ` +
289289
`You may be able to fix this by installing Rosetta: ` +
290290
`softwareupdate --install-rosetta`,
291291
);

0 commit comments

Comments
 (0)