From f2a34141b3891afd7ea19a0766869335676cb8cf Mon Sep 17 00:00:00 2001 From: Dax Date: Tue, 20 Oct 2026 18:39:48 -0400 Subject: [PATCH] chore(infra): delete legacy share storage (#57548) --- infra/app.ts | 18 ++++-------------- infra/share.ts | 3 --- packages/function/src/api.ts | 4 ---- sst-env.d.ts | 2 -- 4 files changed, 4 insertions(+), 23 deletions(-) diff --git a/infra/app.ts b/infra/app.ts index 2f18f68dbf1..1ac14597e96 100644 --- a/infra/app.ts +++ b/infra/app.ts @@ -8,14 +8,12 @@ const DISCORD_SUPPORT_BOT_TOKEN = new sst.Secret("DISCORD_SUPPORT_BOT_TOKEN") const DISCORD_SUPPORT_CHANNEL_ID = new sst.Secret("DISCORD_SUPPORT_CHANNEL_ID") const FEISHU_APP_ID = new sst.Secret("FEISHU_APP_ID") const FEISHU_APP_SECRET = new sst.Secret("FEISHU_APP_SECRET") -const bucket = new sst.cloudflare.Bucket("Bucket") export const api = new sst.cloudflare.Worker("Api", { domain: `api.${domain}`, handler: "packages/function/src/api.ts", url: true, link: [ - bucket, GITHUB_APP_ID, GITHUB_APP_PRIVATE_KEY, ADMIN_SECRET, @@ -28,19 +26,11 @@ export const api = new sst.cloudflare.Worker("Api", { worker: (args) => { args.logpush = true if ($app.stage === "vimtor" || $app.stage === "adam") return - args.bindings = $resolve(args.bindings).apply((bindings) => [ - ...bindings, - { - name: "SYNC_SERVER", - type: "durable_object_namespace", - className: "SyncServer", - }, - ]) + // Deleting the class erases every SyncServer Durable Object and its stored share data. args.migrations = { - // Note: when releasing the next tag, make sure all stages use tag v2 - oldTag: $app.stage === "production" || $app.stage === "thdxr" ? "" : "v1", - newTag: $app.stage === "production" || $app.stage === "thdxr" ? "" : "v1", - //newSqliteClasses: ["SyncServer"], + oldTag: $app.stage === "production" || $app.stage === "thdxr" ? undefined : "v1", + newTag: "v2", + deletedClasses: ["SyncServer"], } }, }, diff --git a/infra/share.ts b/infra/share.ts index 7f32fbb6ef3..4f54cb07d8c 100644 --- a/infra/share.ts +++ b/infra/share.ts @@ -1,8 +1,5 @@ import { shortDomain } from "./stage" -// Retains existing share data until it is deleted separately. -new sst.cloudflare.Bucket("EnterpriseStorage") - // The Share worker takes over the hostname of the retired Teams worker. Cloudflare rejects a second custom domain for // the same hostname, so adopt the Teams domain and replace it, deleting the old one first. $transform(cloudflare.WorkersCustomDomain, (_args, opts, name) => { diff --git a/packages/function/src/api.ts b/packages/function/src/api.ts index 60e2fd72cdc..f63563eecf5 100644 --- a/packages/function/src/api.ts +++ b/packages/function/src/api.ts @@ -1,14 +1,10 @@ import { Hono } from "hono" -import { DurableObject } from "cloudflare:workers" import { jwtVerify, createRemoteJWKSet } from "jose" import { createAppAuth } from "@octokit/auth-app" import { Octokit } from "@octokit/rest" import { Resource } from "sst" import { parseRepositoryClaim } from "./github" -// Inert: the SYNC_SERVER binding and existing Durable Objects still reference this class, so it must stay exported. -export class SyncServer extends DurableObject {} - export default new Hono() .get("/", (c) => c.text("Hello, world!")) .post("/feishu", async (c) => { diff --git a/sst-env.d.ts b/sst-env.d.ts index bcfa83ba237..61e3c7c3fcc 100644 --- a/sst-env.d.ts +++ b/sst-env.d.ts @@ -19,7 +19,6 @@ declare module "sst" { "value": string } "Api": import("@cloudflare/workers-types").Service - "Bucket": import("@cloudflare/workers-types").R2Bucket "Console": { "type": "sst.cloudflare.SolidStart" "url": string @@ -36,7 +35,6 @@ declare module "sst" { "type": "sst.sst.Secret" "value": string } - "EnterpriseStorage": import("@cloudflare/workers-types").R2Bucket "FEISHU_APP_ID": { "type": "sst.sst.Secret" "value": string