## Problem
Opting out from the Privacy Settings modal (www, docs, kb) clears no
cookies, and GTM keeps running. The banner's Opt out misses `_ga_<id>`,
`_dcid`, and PostHog.
## Solution
- `revokeTrackingConsent()` runs from `denyAll`, and from
`updateServices` unless every service is accepted. It clears `_ga`,
`_ga_*`, `_gcl_*`, `FP*`, `_dcid`, `session_id`, `ph_*_posthog`,
PostHog's localStorage, stale consent copies.
- PostHog resets and opts out, with persistence off. The opt-out
survives sign-out. A saved accept opts back in.
- Every opt-out calls `POST /platform/telemetry/reset` (keepalive,
errors ignored) to clear the API's HttpOnly `session_id`,
`anonymous_id`, and `user_id`. Studio's own call is removed.
- To stop GTM, a saved opt-out reloads the page if tracking was on,
waiting at most 1s for the reset.
## Review instructions
1. `cd packages/common && npx vitest run consent-state.test.ts
posthog-client.test.ts`
2. On prod: accept, open Privacy Settings, turn Marketing off, Confirm.
The page reloads with cookies gone and no `collect` request.
Tested: `common` (237 pass), `AnalyticsSettings` tests, CI unit tests
and typecheck. No browser test (previews lack Usercentrics).
## Checklist
- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [ ] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill
Adds an optional onboarding survey to the new-organization form, so we
learn who new orgs are for and what they are building. Users in the
`org_form` arm of the `onboardingSurveyPlacement` PostHog flag see a
**Help improve Supabase** section. Users in `control` get today's form
unchanged and still record exposure, so the two arms can be compared;
users the flag doesn't assign get the existing form and record nothing.
**Changed:**
- **Survey on the new-org form**: asks **Who is this org for?** (plus
**How many people?** for companies) and **What are you building?** (AI
assistant or agent, AI search or knowledge base, B2B SaaS, internal
tool, consumer app, social or community, marketplace or booking,
e-commerce, developer tool or app builder, analytics or reporting,
other). Every question ends with **Prefer not to say**. Answers go to
`POST /platform/organizations/onboarding-survey` as `kind`, `size` and
`building`.
- **Follow-up card for a blank survey**: if the creator answers nothing,
a card in the bottom-right asks the same questions for 5 minutes after
the org is created (not on project creation pages). Only the creator
sees it, once, tracked in localStorage. A blank form sends nothing at
creation, because the platform keeps only the first survey response per
user and org. Skipping the card, closing it, or letting the 5 minutes
run out still saves the org type and size picked on the form.
- **Telemetry**: exposure for both arms, plus submit, submit failed,
dismissed (including `follow_up_expired` when the card times out) and
Answer clicked events with `surface` set to `org_form` or `follow_up`.
**Note:** I cut **How comfortable are you working with code?** from v1.
The survey endpoint doesn't accept `coding_experience` yet, and the
question is planned to move to the user level later.
## To test
Setup: override `onboardingSurveyPlacement` to `org_form` in the dev
toolbar. Close the Terms of Service banner first, since the follow-up
card shares its slot.
Tested on the PR preview:
- [x] Create an org with **Who is this org for?** and **What are you
building?** answered, expect one `POST
/platform/organizations/onboarding-survey` carrying `kind` and
`building` (plus `size` for companies), no `coding_experience` key, and
no `kind` or `size` in the org-create request. Observed: 204 with
`{"slug":"<slug>","kind":"COMPANY","size":"10","building":"b2b_saas"}`;
org-create body was `{"name":"<name>","tier":"tier_free"}`
- [x] Create an org with the survey left blank, then open its projects
page, expect the follow-up card; answer it, expect the same survey
request and a "Thanks for sharing" toast. Observed: no survey request at
creation; after answering, 204 with
`{"slug":"<slug>","kind":"PERSONAL","building":"consumer_app"}` and the
toast
- [x] Override to `control`, open the new-org form, expect the same form
as master (Name, Type, Company size with "How many people are in your
company?" for Company, then Plan), no survey section, and an
`onboarding_survey_placement_experiment_exposed` event with `variant:
control`. Observed: screenshots match master's form field for field; the
exposure arrived in PostHog with `variant: control`
- [x] Create an org with the survey left blank and don't act on the
follow-up card for 5 minutes, expect the card to disappear, one `POST
/platform/organizations/onboarding-survey` carrying the form's `kind`
(plus `size` for companies) and no `building`, and an
`onboarding_survey_dismissed` event with `reason: follow_up_expired`.
Observed (stored follow-up time moved to near expiry instead of
waiting): the card disappeared at the 5-minute mark with one 204
carrying `{"slug":"<slug>","kind":"AGENCY"}` and the `follow_up_expired`
event; an already-expired follow-up sends on page load; with the dialog
open past expiry nothing is sent until it is closed
## Linear
- fixes GROWTH-771
- part of GROWTH-1463
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
Co-authored-by: Pamela Chia <pamelachiamayyee@gmail.com>
Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
## Problem
Skipped recovery reminders need a consistent reminder interval for each
signed-in person in the browser.
## Solution
Snooze missing codes for thirty days and exhausted codes for seven days.
Escalation breaks snooze; sign-out preserves it. Completing codes, or
adding a backup factor for exhausted codes, resolves the applicable gap.
Track task actions, completion and dismissal.
## Review instructions
**This PR’s own deploy preview cannot show the takeover.** Review its
diff here, but test the assembled stack on [#51643’s staging
preview](https://studio-staging-git-dnywh-account-recovery-interstitial-supabase.vercel.app/dashboard/organizations).
The controller only mounts in #51643.
Before each scenario: use a non-SSO staging test account with MFA
verified; check `enableAccountRecoveryInterstitial` and
`enableAuthRecoveryCodes` are both true in the staging dev toolbar, then
close the toolbar and other dialogs. Clear
`account-recovery-reminder:<userId>` from DevTools Application → Local
Storage **for that preview origin**, then reload the dashboard.
1. Use an account with existing codes and exactly one verified
authenticator. Override GET `/factors/recovery-codes` in DevTools
Network: retain JSON fields, set `remaining` to `0`, save and reload.
Confirm the overridden request succeeds and the takeover opens.
2. Skip. Confirm the URL stays unchanged and the local-storage record
has critical severity with expiry seven days ahead. In a separate
scenario, genuinely missing codes should record warning severity with
expiry thirty days ahead.
3. Reload, switch projects or organisations, then sign out and back in.
The reminder stays hidden. Clear the record and reload to retest.
4. Disable overrides before live actions. Save codes and Continue; the
record clears. Adding a second authenticator resolves exhausted codes
but must not resolve missing codes. Use separate test accounts for these
cases.
## Context
_TLDR: Changes here speeds up unit tests on CI from ~14 minutes to ~3
minutes_ 😂
_TLDR 2: The file changes are solely only test files +
`studio-unit-tests.yml`_
We've currently got a lot of unit tests in the repository which while
great for coverage, hasn't been ideally written. There's a lot of
redundancy + overly specific tests that break easily, and our current
unit test takes about 15 minutes to run in the GHA per PR. Hence am
doing a audit clean up of all existing unit tests in the studio repo.
## Changes involved
- `.test.ts` files now run in `node`, `.test.tsx` in `jsdom`
- jsdom costs about 1s of setup per file. A `.ts` test that needs the
DOM opts in with `// @vitest-environment jsdom` (46 files do).
- Removed redundant and over-specific tests
- Duplicates are merged into `test.each`. Tests that only covered
libraries, existed for coverage, or asserted class names and snapshots
are deleted. 19 files are merged into a sibling or deleted.
- Fixed about 15 tests that couldn't fail
- Examples: unawaited assertions, fixtures equal to the default, and a
`semverGte` test calling `semverLte`.
- Sped up the slowest files
- Real sleeps are replaced with fake timers, `user.type` with paste, and
Radix option queries are scoped to the open listbox. For example,
`RestoringState` went from 18s to 0.3s and
`useTableEditorFiltersSort.navigation` from 20s to 3s.
- These ^ already shave down the unit tests time from 14 mins to 9 mins,
but am also sharding unit tests across 4 jobs to increase speed up
further which then shaves down time to 3 mins now
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.
YES
## What kind of change does this PR introduce?
- Remove queue operations from feature preview into settings
- Refactor dashboard settings
- Resolves DEPR-434
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Dashboard settings panel in Account preferences with toggles for
Inline Editor and Queue Operations; “Dashboard” added to project
Configuration.
* **Removed**
* Old Inline Editor settings UI and the Queue Operations feature-preview
UI removed.
* **Refactor**
* Consolidated dashboard preferences into a single settings surface;
banners and actions now navigate to preferences; account/preferences
layouts and back-navigation behavior adjusted for platform vs
self-hosted.
* **Tests**
* Added tests for settings UI, menu generation, redirects, and
local-storage.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com>