Open source CapCut alternative.
TypeScript
fix(site): record why the storage wall's move off the cloud failed
David Leb4cc6336a619
diff --git a/site/src/cut/components/StorageUpgradeDialog.tsx b/site/src/cut/components/StorageUpgradeDialog.tsxindex 2fa722f4..a93700ab 100644--- a/site/src/cut/components/StorageUpgradeDialog.tsx+++ b/site/src/cut/components/StorageUpgradeDialog.tsx@@ -35,6 +35,7 @@ import { onOperationFailure } from "@/cut/lib/operationFailure";import { moveOpenProject } from "@/cut/lib/projectMove";import type { Residency } from "@/cut/lib/residency";import { useEditor } from "@/cut/lib/store";+import { errorFields } from "@/cut/lib/userError";import { useDescribeError } from "@/i18n/describeError";import { formatBytes } from "@/lib/bytes";@@ -206,6 +207,10 @@ function useMoveOffCloud(surface: WallSurface): MoveOffCloud | null {window.location.href = projectHref(base, newId, "projects", null);}).catch((e: unknown) => {+ track("cut_storage_move_failed", {+ to,+ error: errorFields(e, String(e)).errorCode ?? (e instanceof Error ? e.name : "unknown"),+ });setError(describeError(e, t("storage.moveFailed")));setMoving(false);setProgress(null);diff --git a/site/src/lib/analytics.ts b/site/src/lib/analytics.tsindex 0a1fdae2..cb3f2581 100644--- a/site/src/lib/analytics.ts+++ b/site/src/lib/analytics.ts@@ -92,10 +92,12 @@ export type AnalyticsEvents = {// The top bar's credits pill.cut_credits_pill_clicked: { credits: number; dollars: number };cut_storage_upgrade_shown: { source: "quota-413" | "import" | "render" | "pill" };- // The storage wall's move of a cloud project to this computer: started, and- // landed (the copy opens next).+ // The storage wall's move of a cloud project to this computer: started,+ // landed (the copy opens next), or failed with the error's code, or its+ // name when it carries none.cut_storage_move_started: { to: "local" | "browser" | "cloud" };cut_storage_move_done: { to: "local" | "browser" | "cloud" };+ cut_storage_move_failed: { to: "local" | "browser" | "cloud"; error: string };// The plans modal: shown, and closed without a checkout after `seconds` up.// entry is the button or limit that raised it; intro is the open discount's// percent, 0 for none.