Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion app/api/projects/v2/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ export async function GET(request: NextRequest) {
account.identity,
projectId(request.nextUrl.searchParams.get("id")),
);
if (!stored) return json({ error: "Project V2 snapshot was not found." }, 404);
// A missing cloud snapshot is an expected state for browser-local projects.
// Return a successful empty receipt so Chromium does not surface a noisy
// failed-resource console error while Studio falls back to its local copy.
if (!stored) return json({ found: false });
return json(stored);
} catch (error) {
return responseError(error);
Expand Down
1 change: 1 addition & 0 deletions lib/project-v2-sync-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export async function loadProjectV2FromCloud(projectId: string): Promise<{
if (response.status === 404) return null;
const value = await responseValue(response);
if (!response.ok) throw syncError(response, value);
if (value.found === false) return null;
if (!value.project || typeof value.project !== "object" || !Number.isSafeInteger(value.storageRevision)) {
throw new ProjectV2SyncError({ message: "Project V2 cloud sync returned an invalid snapshot.", status: 502 });
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions tests/vercel-sandbox-runtime-cleanup.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,14 @@ test("Project V2 accepts the browser-visible host behind a trusted same-origin p
assert.equal((await response.json()).storageRevision, 1);
});

test("missing Project V2 reads return a successful empty receipt without a browser 404", async () => {
globalThis.__DROPS_STUDIO_LOCAL_PROJECT_V2__?.clear();
const { cookie } = guestSession();
const response = await getProjectV2(getRequest("browser-local-only-project", cookie));
assert.equal(response.status, 200);
assert.deepEqual(await response.json(), { found: false });
});

test("Project V2 deletion fails closed and retains storage when Sandbox destroy fails", async () => {
globalThis.__DROPS_STUDIO_LOCAL_PROJECT_V2__?.clear();
globalThis.__DROPS_STUDIO_LOCAL_PROJECT_V2_RELEASE_RECEIPTS__?.clear();
Expand Down
Loading