Skip to content

Comments

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

Open
sid2487 wants to merge 2 commits intoprocessing:developfrom
sid2487:fix/mongo-preview-server
Open

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

Conversation

@sid2487
Copy link
Contributor

@sid2487 sid2487 commented Feb 10, 2026

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

welcome bot commented Feb 10, 2026

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

@Iron-56
Copy link
Contributor

Iron-56 commented Feb 11, 2026

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

@sid2487
Copy link
Contributor Author

sid2487 commented Feb 11, 2026

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.

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