Repository navigation
fix(action-center): run Getting started for the first real brand when a demo brand came first - #1799
Merged
Conversation
… a demo brand came first 00197 runs Getting started at once for an organization's first brand and asks first for a later one. Since the demo brand (00380) comes first for a person who starts without a card, the brand they set up after adding a card counted as a later one, so the Actions page said "No actions yet" instead of the 17 steps. 00383 leaves demo brands out of that check and runs it now for the real brands it caught. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rand" 00383's backfill also confirmed a second brand whose first brand was deleted, in an organization that never had a demo brand. Limit it to organizations with a demo brand. The demo brand's created_at is counted back from each rebuild, so it isn't compared. Claude-Session: https://claude.ai/code/session_0121amRjX7UFrgmGELAtkc7A
gkhngyk
approved these changes
Oct 30, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Looks good with acf56dd: I made one change to the backfill (below) and it's ready.
The change
- The backfill could also confirm a brand the demo brand didn't affect. Take an organization that never had a demo brand: its first brand was deleted, and the second still asks "Run Getting started?". It has no real brand before it, so the backfill started Getting started for it without an answer.
take-1799adds one condition: the organization has a demo brand. The demo brand'screated_atisn't compared, because the demo builder counts it back from each rebuild (server/src/lib/demo/core.js). So it can land after a real brand that was really made later.- The migration's comment says the same.
schema.sqlis rebuilt withbuild-schema.sh. - A second test in
start-trigger.test.tschecks the condition. It fails on this branch's migration and passes with the fix.
What I checked
- The trigger. It's the same function as 00197, with
and not b.is_demoadded. It's stillsecurity definerwithsearch_path = public, and still revoked frompublic,anonandauthenticated. Its trigger from 00196 is unchanged.- A demo brand inserted into an organization with no real brand still runs at once, as before. The demo builder then upserts its own row.
- The demo brand's rows.
- The backfill updates only rows with
not b.is_demo, so 00381's trigger never sees a demo brand's row here. - The trigger's insert runs inside the brands trigger (depth 2), so 00381 lets it through, the same as on main.
- The backfill updates only rows with
- Existing state.
- Only rows with both
confirmed_atanddismissed_atnull change. A brand someone started or skipped is left alone. started_atandgetting_started_stepsare untouched. Nothing is reset.- A real second brand still asks.
- The page reads
confirmed_atonly as a yes/no (steps.ts), so the backfill'snow()doesn't move any step.
- Only rows with both
- Size.
getting_startedhas one row per brand. The update locks only the rows it changes. There's no rewrite and no new index. - Merge and numbering.
- The branch is on the current main and merges clean.
- 00383 is unique among main and the open PRs.
- Every open PR with a migration also changes
schema.sql. Whichever merges second rebuilds it withbuild-schema.sh.
- Tests.
src/lib/getting-started: 25/25 with the fix.- Server
src/lib/demo: 118/118. plan-row.test.tspasses. No client code changes.
Deploy
Apply 00383 (from take-1799) on prod, then merge. No app change.
This was referenced Oct 30, 2026
gkhngyk
approved these changes
Oct 30, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Merging in order with the other approved PRs. This head merges current main; its tree is what main will be after this squash, checked with the full server and web suites, tsc, lint, format and next build. Migration 00383 is applied on production just before the merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Found while testing onboarding: after adding a card, the Action Center said No actions yet instead of Getting started's 17 steps.
Why:
confirmed_at = nulland asks first.activestayed false.00383:
start_brand_getting_startedcounts only the organization's other real brands (not b.is_demo). The demo brand itself is unchanged; its builder writes its own row.confirmed_atanddismissed_atnull and no real brand before it in its organization. A real second brand still asks, as before.Related issue
None. Found in onboarding testing, after the demo brand chain (#1734–#1740).
Type of change
fix— Bug fixHow to test
confirmed_atset) and the second asks (null). The run ended withROLLBACK.web/src/lib/getting-started/start-trigger.test.ts: the latest trigger definition inschema.sqlleaves demo brands out.Deploy: apply 00383 (no app change needed). Its backfill also fixes brands created since the demo brand went live.
Checklist
bash supabase/build-schema.sh:schema.sqlis current (00383)src/lib/getting-started24/24; serverdemo/coverage.test.js7/7)🤖 Generated with Claude Code