The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Use production terminology for staging restrictions and fix delete cron enqueue
Kiran K4e34f2cde9b0
diff --git a/apps/web/app/api/workspaces/[idOrSlug]/route.ts b/apps/web/app/api/workspaces/[idOrSlug]/route.tsindex 2c10eb136f..828e9787ea 100644--- a/apps/web/app/api/workspaces/[idOrSlug]/route.ts+++ b/apps/web/app/api/workspaces/[idOrSlug]/route.ts@@ -104,7 +104,7 @@ export const PATCH = withWorkspace(throw new DubApiError({code: "forbidden",message:- "This action is not available in a staging workspace. Use the live workspace instead.",+ "This action is not available in a staging workspace. Use the production workspace instead.",});}diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/members/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/members/page-client.tsxindex 2b85bd4dd2..d783b7eaf8 100644--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/members/page-client.tsx+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/members/page-client.tsx@@ -249,7 +249,7 @@ export function WorkspaceMembersClient() {role,environment,customPermissionDescription: "invite new teammates",- stagingBehavior: "live-only",+ stagingBehavior: "production-only",});const { error: generateInviteLinksError } = clientAccessCheck({@@ -257,7 +257,7 @@ export function WorkspaceMembersClient() {role,environment,customPermissionDescription: "generate invite links",- stagingBehavior: "live-only",+ stagingBehavior: "production-only",});return (@@ -394,7 +394,7 @@ function RoleCell({}}title={isStaging- ? "Roles are managed from the live workspace"+ ? "Roles are managed from the production workspace": !isCurrentUserOwner? "Only owners can change member roles": isCurrentUserdiff --git a/apps/web/lib/api/workspaces/delete-workspace.ts b/apps/web/lib/api/workspaces/delete-workspace.tsindex e4f1a4d58f..351d785dfc 100644--- a/apps/web/lib/api/workspaces/delete-workspace.ts+++ b/apps/web/lib/api/workspaces/delete-workspace.ts@@ -73,25 +73,16 @@ export async function deleteWorkspace(]);waitUntil(- Promise.allSettled([- qstash.publishJSON({- url: `${APP_DOMAIN_WITH_NGROK}/api/cron/workspaces/delete`,- body: {- workspaceId: workspace.id,- },+ Promise.allSettled(+ workspaces.map((workspace) => {+ return qstash.publishJSON({+ url: `${APP_DOMAIN_WITH_NGROK}/api/cron/workspaces/delete`,+ body: {+ workspaceId: workspace.id,+ },+ });}),-- ...(stagingWorkspace- ? [- qstash.publishJSON({- url: `${APP_DOMAIN_WITH_NGROK}/api/cron/workspaces/delete`,- body: {- workspaceId: stagingWorkspace.id,- },- }),- ]- : []),- ]),+ ),);}diff --git a/apps/web/lib/auth/workspace.ts b/apps/web/lib/auth/workspace.tsindex dd57738c50..ae0b3dc857 100644--- a/apps/web/lib/auth/workspace.ts+++ b/apps/web/lib/auth/workspace.ts@@ -469,7 +469,7 @@ export const withWorkspace = (throw new DubApiError({code: "forbidden",message:- "This action is not available in a staging workspace. Use the live workspace instead.",+ "This action is not available in a staging workspace. Use the production workspace instead.",});}diff --git a/apps/web/lib/client-access-check.ts b/apps/web/lib/client-access-check.tsindex dd150147f2..de5edf7a5e 100644--- a/apps/web/lib/client-access-check.ts+++ b/apps/web/lib/client-access-check.ts@@ -13,7 +13,7 @@ export const clientAccessCheck = ({role: WorkspaceRole;customPermissionDescription?: string;environment?: WorkspaceEnvironment | null;- stagingBehavior?: "blocked" | "live-only";+ stagingBehavior?: "blocked" | "production-only";}) => {if (environment === WorkspaceEnvironment.staging) {switch (stagingBehavior) {@@ -23,10 +23,10 @@ export const clientAccessCheck = ({error: "This action is not available in staging workspaces.",};- case "live-only":+ case "production-only":return {allowed: false,- error: "This setting must be managed from the live workspace.",+ error: "This setting must be managed from the production workspace.",};}}diff --git a/apps/web/lib/sandbox/sync-workspace.ts b/apps/web/lib/sandbox/sync-workspace.tsindex 2df47a474a..482b0d774e 100644--- a/apps/web/lib/sandbox/sync-workspace.ts+++ b/apps/web/lib/sandbox/sync-workspace.ts@@ -1,7 +1,7 @@import { prisma } from "@dub/prisma";import { Project, WorkspaceRole } from "@dub/prisma/client";-// We don't sync the machine user from the live workspace to the staging workspace+// We don't sync the machine user from the production workspace to the staging workspaceexport async function addMemberToStaging({workspace,diff --git a/apps/web/ui/workspaces/upload-logo.tsx b/apps/web/ui/workspaces/upload-logo.tsxindex 284c14b517..1c8058451f 100644--- a/apps/web/ui/workspaces/upload-logo.tsx+++ b/apps/web/ui/workspaces/upload-logo.tsx@@ -20,7 +20,7 @@ export default function UploadLogo() {action: "workspaces.write",role,environment,- stagingBehavior: "live-only",+ stagingBehavior: "production-only",});return (