Skip to content

fix(core): Don't show setup in demo mode#26233

Merged
yehorkardash merged 2 commits intomasterfrom
fix-preview-setup
Feb 25, 2026
Merged

fix(core): Don't show setup in demo mode#26233
yehorkardash merged 2 commits intomasterfrom
fix-preview-setup

Conversation

@yehorkardash
Copy link
Contributor

@yehorkardash yehorkardash commented Feb 25, 2026

Summary

This PR fixes issue when sometimes in demo mode n8n returned showSetupOnFirstLoad: true

Testing:

  • copy hooks directory locally from here
  • Set those envs
EXTERNAL_HOOK_FILES=path/to/hooks/directory
N8N_PREVIEW_MODE=true
NODE_ENV=production
N8N_USER_MANAGEMENT_JWT_SECRET=secret

Related Linear tickets, Github issues, and Community forum posts

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@yehorkardash yehorkardash requested a review from Matsuuu February 25, 2026 10:24
@Matsuuu
Copy link
Member

Matsuuu commented Feb 25, 2026

I'd also prefer is someone more familiar with the codebase co-reviewed this with me 👍🏼 🙂

@yehorkardash yehorkardash added release/backport Pull request is a backport or needs to be backported. Backport to Beta Backport to Stable labels Feb 25, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Architecture diagram
sequenceDiagram
    participant Client as Frontend UI
    participant FS as FrontendService
    participant Env as Environment (N8N_PREVIEW_MODE)
    participant OS as OwnershipService

    Note over Client, OS: Request for application configuration
    Client->>FS: getPublicSettings()
    FS->>FS: getSettings()
    
    FS->>Env: Check process.env.N8N_PREVIEW_MODE
    
    FS->>FS: NEW: getShowSetupOnFirstLoad()
    
    alt NEW: Preview/Demo Mode is Enabled (true)
        Note right of FS: Bypass DB check to allow demo access
        FS->>FS: Set showSetupOnFirstLoad = false
    else Standard Mode
        FS->>OS: hasInstanceOwner()
        OS-->>FS: return boolean
        FS->>FS: CHANGED: Set showSetupOnFirstLoad = !hasInstanceOwner
    end

    FS-->>FS: Update this.settings.userManagement
    FS-->>Client: Return PublicFrontendSettings (showSetupOnFirstLoad)

    Note over Client: If false, user bypasses setup<br/>and enters the app directly.
Loading

Copy link
Contributor

@MiloradFilipovic MiloradFilipovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for addressing this 🙌

@yehorkardash yehorkardash added this pull request to the merge queue Feb 25, 2026
Merged via the queue into master with commit 36bde68 Feb 25, 2026
54 checks passed
@yehorkardash yehorkardash deleted the fix-preview-setup branch February 25, 2026 12:04
@n8n-assistant n8n-assistant bot mentioned this pull request Feb 25, 2026
@n8n-assistant
Copy link
Contributor

n8n-assistant bot commented Feb 25, 2026

Got released with [email protected]

@codecov
Copy link

codecov bot commented Feb 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport to Beta Backport to Stable release/backport Pull request is a backport or needs to be backported. Released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants