From e72e498afa06c8c0d78e4d4fea028aa337baa509 Mon Sep 17 00:00:00 2001 From: mantrakp04 Date: Wed, 6 May 2026 15:24:14 -0700 Subject: [PATCH 1/2] fix(tests): use sql.json in onboarding migration test and refresh metrics snapshot - Match the rest of the migration test suite by using `sql.json(...)` instead of `${JSON.stringify(...)}::jsonb` in the `add_project_onboarding_state` test, so the helper handles serialization and parameter binding consistently. - Refresh the `internal-metrics` snapshot so that `active_users_by_country.AQ` reflects the actual `last_active_at_millis desc` ordering produced by the test (mailbox-2 became active in AQ after mailbox-1, so it sorts first). Co-authored-by: Cursor --- .../tests/default-and-updates.ts | 2 +- .../api/v1/__snapshots__/internal-metrics.test.ts.snap | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/backend/prisma/migrations/20260420000000_add_project_onboarding_state/tests/default-and-updates.ts b/apps/backend/prisma/migrations/20260420000000_add_project_onboarding_state/tests/default-and-updates.ts index a474db0171..b6ae32b463 100644 --- a/apps/backend/prisma/migrations/20260420000000_add_project_onboarding_state/tests/default-and-updates.ts +++ b/apps/backend/prisma/migrations/20260420000000_add_project_onboarding_state/tests/default-and-updates.ts @@ -29,7 +29,7 @@ export const postMigration = async (sql: Sql, ctx: Awaited", "last_active_at_millis": , - "primary_email": "mailbox-1--@stack-generated.example.com", + "primary_email": "mailbox-2--@stack-generated.example.com", "profile_image_url": null, "signed_up_at_millis": , }, @@ -2443,7 +2443,7 @@ NiceResponse { "display_name": null, "id": "", "last_active_at_millis": , - "primary_email": "mailbox-2--@stack-generated.example.com", + "primary_email": "mailbox-1--@stack-generated.example.com", "profile_image_url": null, "signed_up_at_millis": , }, From ca17a1100e2acf30d038bd3a89b2d38c294a3b25 Mon Sep 17 00:00:00 2001 From: mantrakp04 Date: Thu, 7 May 2026 12:55:56 -0700 Subject: [PATCH 2/2] fix(tests): cast onboardingState to jsonb in migration test - Updated the SQL query in the onboarding migration test to explicitly cast the onboardingState to jsonb, ensuring proper data type handling during the update process. --- .../tests/default-and-updates.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/backend/prisma/migrations/20260420000000_add_project_onboarding_state/tests/default-and-updates.ts b/apps/backend/prisma/migrations/20260420000000_add_project_onboarding_state/tests/default-and-updates.ts index b6ae32b463..b852c388a6 100644 --- a/apps/backend/prisma/migrations/20260420000000_add_project_onboarding_state/tests/default-and-updates.ts +++ b/apps/backend/prisma/migrations/20260420000000_add_project_onboarding_state/tests/default-and-updates.ts @@ -29,7 +29,7 @@ export const postMigration = async (sql: Sql, ctx: Awaited