Skip to content

Fix MongoDB config and remove unnecessary DB dependency from preview server#3858

Open
siddocode wants to merge 5 commits intoprocessing:developfrom
siddocode:fix/mongo-preview-server
Open

Fix MongoDB config and remove unnecessary DB dependency from preview server#3858
siddocode wants to merge 5 commits intoprocessing:developfrom
siddocode:fix/mongo-preview-server

Conversation

@siddocode
Copy link
Copy Markdown
Contributor

This PR fixes MongoDB configuration inconsistencies and removes an unnecessary
database dependency from the preview server.

Changes

  • Standardize MongoDB configuration using MONGO_URI
  • Maintain backward compatibility with MONGO_URL
  • Update session store to use a single Mongo connection source
  • Remove MongoDB connection from preview server (not required at runtime)
  • Align .env.example with actual runtime expectations

Why

On a fresh local setup, the preview server attempted to connect to MongoDB using
credentials that may not exist, causing the application to crash. The preview
server does not require database access, so removing this dependency simplifies
local development and prevents startup crashes.

Testing

  • Tested locally with Docker MongoDB
  • Verified editor and preview servers start successfully

@welcome
Copy link
Copy Markdown

welcome Bot commented Feb 10, 2026

🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already.

@kitlord
Copy link
Copy Markdown
Contributor

kitlord commented Feb 11, 2026

Hey I tested and it works out, but doesn't changing the cookie lifetime affect the editor itself?

@siddocode
Copy link
Copy Markdown
Contributor Author

Hey I tested and it works out, but doesn't changing the cookie lifetime affect the editor itself?

The cookie maxAge remains unchanged (4 weeks), so session duration and editor behavior are unaffected.

I removed the explicit ttl option from MongoStore.create() because connect-mongo automatically derives TTL from the session cookie's maxAge.

This avoids redundant configuration while keeping the same session lifetime behavior.

@kitlord
Copy link
Copy Markdown
Contributor

kitlord commented Feb 25, 2026

@raclim could you merge the PR? Sorry for the late review, got busy with some work.

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.

2 participants