Skip to content

Fix Docker sidebar and chat history persistence#791

Merged
miurla merged 2 commits into
mainfrom
fix/docker-sidebar-and-db-override
Mar 29, 2026
Merged

Fix Docker sidebar and chat history persistence#791
miurla merged 2 commits into
mainfrom
fix/docker-sidebar-and-db-override

Conversation

@miurla
Copy link
Copy Markdown
Owner

@miurla miurla commented Mar 29, 2026

Summary

  • Show sidebar and trigger button in anonymous mode (ENABLE_AUTH=false) by using getCurrentUserId() instead of Supabase user for hasUser context and AppSidebar rendering
  • Override DATABASE_RESTRICTED_URL in docker-compose to prevent cloud DB connection strings from .env.local taking precedence over the local Docker PostgreSQL

Background

In Docker deployments with ENABLE_AUTH=false, two issues prevented chat history from working:

  1. Sidebar not visible: AppSidebar and SidebarTrigger were gated on !!user (Supabase auth), which is always null when Supabase is not configured. Changed to !!userId from getCurrentUserId(), which returns docker-anonymous in anonymous mode.

  2. DB connection failure: DATABASE_RESTRICTED_URL from .env.local (pointing to a cloud DB like Neon) was taking precedence over the Docker-local DATABASE_URL due to the app preferring DATABASE_RESTRICTED_URL via nullish coalescing. Now explicitly set in docker-compose to use the local PostgreSQL.

Test plan

  • docker compose up -d --build starts successfully
  • Sidebar trigger button visible on top-left of the page
  • Search creates a chat and it appears in sidebar history
  • Clicking history item loads the saved chat
  • Supabase-authenticated deployments still work as before

🤖 Generated with Claude Code

- Use getCurrentUserId() instead of Supabase user for sidebar visibility
  and hasUser context, so sidebar and trigger button appear in anonymous
  mode (ENABLE_AUTH=false)
- Override DATABASE_RESTRICTED_URL in docker-compose to prevent cloud DB
  connection strings from .env.local taking precedence over the local
  Docker PostgreSQL

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
morphic Ready Ready Preview, Comment Mar 29, 2026 7:08am

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cb3d6eacd4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/layout.tsx Outdated
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@miurla miurla merged commit ebe3b60 into main Mar 29, 2026
8 checks passed
@miurla miurla deleted the fix/docker-sidebar-and-db-override branch March 29, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant