Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix: accept every Cap video id format when restarting Loom imports

Richie McIlroyc3297b971120
diff --git a/apps/web/__tests__/unit/loom-importer-redrive.test.ts b/apps/web/__tests__/unit/loom-importer-redrive.test.ts
index cb3ab80fd..3c0fcd242 100644
--- a/apps/web/__tests__/unit/loom-importer-redrive.test.ts
+++ b/apps/web/__tests__/unit/loom-importer-redrive.test.ts
@@ -364,6 +364,12 @@ describe("POST /api/internal/loom-imports/redrive", () => {
expect((await call(body)).status).toBe(400);
});
+ it("accepts older video ids with uppercase letters and separators", async () => {
+ const response = await call({ videoIds: ["-GwQTqb-_IXEwTf"] });
+ expect(response.status).toBe(200);
+ expect(mocks.start).toHaveBeenCalledOnce();
+ });
+
it("restarts each distinct video once", async () => {
const response = await call({
videoIds: ["abcdefghjkmnpqr", "abcdefghjkmnpqr", "bbcdefghjkmnpqr"],
diff --git a/apps/web/app/api/internal/loom-imports/redrive/route.ts b/apps/web/app/api/internal/loom-imports/redrive/route.ts
index cd422c5dc..14af9aebf 100644
--- a/apps/web/app/api/internal/loom-imports/redrive/route.ts
+++ b/apps/web/app/api/internal/loom-imports/redrive/route.ts
@@ -24,7 +24,7 @@ class Api extends HttpApi.make("LoomImportRedriveApi").add(
.setPayload(
Schema.Struct({
videoIds: Schema.Array(
- Schema.String.pipe(Schema.pattern(/^[a-z0-9]{15}$/)),
+ Schema.String.pipe(Schema.pattern(/^[A-Za-z0-9_-]{15}$/)),
).pipe(Schema.minItems(1), Schema.maxItems(MAX_VIDEOS_PER_REQUEST)),
}),
)