fix(storage): renumber telemetry migration to 0015 to resolve 0014 version collision (#334)
* fix(storage): renumber telemetry migration to 0015 to resolve goose version collision * chore: format with prettier [skip ci] --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
891fb79e79
commit
f98c5e56cc
|
|
@ -320,7 +320,9 @@ ipcMain.handle("daemon:getStatus", () => daemonStatus);
|
||||||
ipcMain.handle("daemon:start", () => startDaemon());
|
ipcMain.handle("daemon:start", () => startDaemon());
|
||||||
ipcMain.handle("daemon:stop", () => stopDaemon());
|
ipcMain.handle("daemon:stop", () => stopDaemon());
|
||||||
ipcMain.handle("app:getVersion", () => app.getVersion());
|
ipcMain.handle("app:getVersion", () => app.getVersion());
|
||||||
ipcMain.handle("telemetry:getBootstrap", () => buildTelemetryBootstrap(process.env, app.getVersion(), process.platform));
|
ipcMain.handle("telemetry:getBootstrap", () =>
|
||||||
|
buildTelemetryBootstrap(process.env, app.getVersion(), process.platform),
|
||||||
|
);
|
||||||
ipcMain.handle("app:chooseDirectory", async () => {
|
ipcMain.handle("app:chooseDirectory", async () => {
|
||||||
const options: OpenDialogOptions = {
|
const options: OpenDialogOptions = {
|
||||||
properties: ["openDirectory"],
|
properties: ["openDirectory"],
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,9 @@ export class TelemetryBoundary extends React.Component<Props, State> {
|
||||||
<div className="flex h-screen items-center justify-center bg-background px-6 text-center text-foreground">
|
<div className="flex h-screen items-center justify-center bg-background px-6 text-center text-foreground">
|
||||||
<div>
|
<div>
|
||||||
<h1 className="text-lg font-semibold">The app hit an unexpected error.</h1>
|
<h1 className="text-lg font-semibold">The app hit an unexpected error.</h1>
|
||||||
<p className="mt-2 text-sm text-muted-foreground">Restart the app or check the daemon logs if this keeps happening.</p>
|
<p className="mt-2 text-sm text-muted-foreground">
|
||||||
|
Restart the app or check the daemon logs if this keeps happening.
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,5 @@
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import {
|
import { routeSurface, sanitizeRendererExceptionProperties, sanitizeRendererProperties } from "./telemetry";
|
||||||
routeSurface,
|
|
||||||
sanitizeRendererExceptionProperties,
|
|
||||||
sanitizeRendererProperties,
|
|
||||||
} from "./telemetry";
|
|
||||||
|
|
||||||
describe("telemetry sanitizers", () => {
|
describe("telemetry sanitizers", () => {
|
||||||
it("categorizes routes without exporting raw paths", () => {
|
it("categorizes routes without exporting raw paths", () => {
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ export async function sanitizeRendererProperties(
|
||||||
case "ao.renderer.orchestrator_open_requested": {
|
case "ao.renderer.orchestrator_open_requested": {
|
||||||
const projectIDHash = await hashedTelemetryID(properties?.project_id);
|
const projectIDHash = await hashedTelemetryID(properties?.project_id);
|
||||||
if (projectIDHash) safe.project_id_hash = projectIDHash;
|
if (projectIDHash) safe.project_id_hash = projectIDHash;
|
||||||
break
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return safe;
|
return safe;
|
||||||
|
|
@ -157,10 +157,7 @@ export async function captureRendererEvent(event: string, properties?: Record<st
|
||||||
posthog.capture(event, safeProperties);
|
posthog.capture(event, safeProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function captureRendererException(
|
export async function captureRendererException(error: unknown, properties?: Record<string, unknown>): Promise<void> {
|
||||||
error: unknown,
|
|
||||||
properties?: Record<string, unknown>,
|
|
||||||
): Promise<void> {
|
|
||||||
if (!(await initTelemetry())) return;
|
if (!(await initTelemetry())) return;
|
||||||
const safeProperties = await sanitizeRendererExceptionProperties(error, properties);
|
const safeProperties = await sanitizeRendererExceptionProperties(error, properties);
|
||||||
posthog.capture("ao.renderer.exception", safeProperties);
|
posthog.capture("ao.renderer.exception", safeProperties);
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,11 @@ import { buildTelemetryBootstrap, defaultDataDir, loadOrCreateTelemetryInstallId
|
||||||
const tempDirs: string[] = [];
|
const tempDirs: string[] = [];
|
||||||
|
|
||||||
afterEach(async () => {
|
afterEach(async () => {
|
||||||
await Promise.all(tempDirs.splice(0).map((dir) => import("node:fs/promises").then(({ rm }) => rm(dir, { recursive: true, force: true }))));
|
await Promise.all(
|
||||||
|
tempDirs
|
||||||
|
.splice(0)
|
||||||
|
.map((dir) => import("node:fs/promises").then(({ rm }) => rm(dir, { recursive: true, force: true }))),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("defaultDataDir prefers AO_DATA_DIR", () => {
|
test("defaultDataDir prefers AO_DATA_DIR", () => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue