Skip to content

Commit 0e4e1fb

Browse files
jordanhunt22Convex, Inc.
authored andcommitted
[Node Migration] Return early on banner if the customer has no deployed node actions (#41280)
GitOrigin-RevId: 8602bdf76ef05ee85518a9355007d6e72cc6b0b7
1 parent 995a647 commit 0e4e1fb

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

npm-packages/system-udfs/convex/_system/frontend/node.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ import { queryPrivateSystem } from "../secretSystemTables";
33
export const version = queryPrivateSystem({
44
args: {},
55
handler: async function ({ db }) {
6+
const modules = await db.query("_modules").take(1000);
7+
const nodeModules = modules.filter((m) => m.environment === "node");
8+
9+
// We keep lambdas around even if they are not currently in use. So, we need to
10+
// return early if there are no node actions currently deployed.
11+
if (nodeModules.length === 0 && modules.length < 1000) {
12+
return null;
13+
}
14+
615
const version = await db
716
.query("_aws_lambda_versions")
817
.order("desc")

npm-packages/system-udfs/convex/schema.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,11 @@ export default defineSchema({
346346
deleted: v.boolean(),
347347
analyzeResult: v.union(analyzedModule, v.null()),
348348
sourcePackageId: v.string(),
349+
environment: v.union(
350+
v.literal("node"),
351+
v.literal("isolate"),
352+
v.literal("invalid"),
353+
),
349354
}).index("by_path", ["path"]),
350355
_auth: defineTable(
351356
v.union(

0 commit comments

Comments
 (0)