From db4d275fa8c4be51815480e0c72fcd694f29b43e Mon Sep 17 00:00:00 2001 From: Bilal Godil Date: Mon, 13 Apr 2026 20:07:18 -0700 Subject: [PATCH 1/2] Skip analytics init on apps without persistent token store Owned admin apps are constructed with `tokenStore: null`, which caused EventTracker/SessionRecorder flushes to throw from _ensurePersistentTokenStore() after #1331 removed the silencing. --- .../src/lib/stack-app/apps/implementations/client-app-impl.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/template/src/lib/stack-app/apps/implementations/client-app-impl.ts b/packages/template/src/lib/stack-app/apps/implementations/client-app-impl.ts index 75008972ee..4422a824c2 100644 --- a/packages/template/src/lib/stack-app/apps/implementations/client-app-impl.ts +++ b/packages/template/src/lib/stack-app/apps/implementations/client-app-impl.ts @@ -563,7 +563,7 @@ export class _StackClientAppImplIncomplete { @@ -573,7 +573,7 @@ export class _StackClientAppImplIncomplete { From cdb0a0ccbae789147cb51d1e9d7188ee0446de36 Mon Sep 17 00:00:00 2001 From: Bilal Godil Date: Tue, 14 Apr 2026 09:22:58 -0700 Subject: [PATCH 2/2] skip feedback tests on local emulator --- .../backend/endpoints/api/v1/internal/feedback.test.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/e2e/tests/backend/endpoints/api/v1/internal/feedback.test.ts b/apps/e2e/tests/backend/endpoints/api/v1/internal/feedback.test.ts index b75e9b767d..c08154293b 100644 --- a/apps/e2e/tests/backend/endpoints/api/v1/internal/feedback.test.ts +++ b/apps/e2e/tests/backend/endpoints/api/v1/internal/feedback.test.ts @@ -2,8 +2,10 @@ import { describe } from "vitest"; import { it } from "../../../../../helpers"; import { Auth, backendContext, createMailbox, niceBackendFetch, waitForOutboxEmailWithStatus } from "../../../../backend-helpers"; +const isLocalEmulator = process.env.NEXT_PUBLIC_STACK_IS_LOCAL_EMULATOR === "true"; + describe("POST /api/v1/internal/feedback", () => { - it("should send feedback from an authenticated user", async ({ expect }) => { + it.runIf(!isLocalEmulator)("should send feedback from an authenticated user", async ({ expect }) => { const senderEmail = backendContext.value.mailbox.emailAddress; const signInResult = await Auth.Otp.signIn(); const recipientMailbox = createMailbox("team@stack-auth.com"); @@ -43,7 +45,7 @@ describe("POST /api/v1/internal/feedback", () => { expect(messages[0].body?.text).toContain("Authenticated feedback from the dashboard."); }); - it("should send feedback without authentication (dev tool)", async ({ expect }) => { + it.runIf(!isLocalEmulator)("should send feedback without authentication (dev tool)", async ({ expect }) => { const recipientMailbox = createMailbox("team@stack-auth.com"); const subject = "[Support] devtool-user@example.com"; @@ -79,7 +81,7 @@ describe("POST /api/v1/internal/feedback", () => { expect(messages[0].body?.text).toContain("Unauthenticated feedback from the dev tool."); }); - it("should send bug reports with correct label", async ({ expect }) => { + it.runIf(!isLocalEmulator)("should send bug reports with correct label", async ({ expect }) => { const recipientMailbox = createMailbox("team@stack-auth.com"); const subject = "[Bug Report] bug@example.com";