Skip to content

Conversation

areibman
Copy link
Contributor

📥 Pull Request

📘 Description
This PR addresses the excessive console errors in local development mode by:

  • Gating PostHog initialization to only run in production or when explicitly enabled via NEXT_PUBLIC_ENABLE_POSTHOG_IN_DEV=true.
  • Adding checks to signin and simple-login pages to prevent unnecessary /opsboard/users/me API calls (and subsequent 401 errors) when no session_id cookie is present.
  • Removing an unused PostHog import.

These changes significantly reduce console noise, improving the local development experience.

🧪 Testing

  1. Without logging in: Hard refresh /signin or /simple-login. Verify that the console is clean, with no PostHog 401/404 errors or /opsboard/users/me 401 errors.
  2. After logging in: Log in as a user. Verify that the application functions normally and that relevant requests (including /opsboard/users/me) are made without the previous noise.
  3. (Optional) Enable PostHog in dev: Set NEXT_PUBLIC_ENABLE_POSTHOG_IN_DEV=true in .env.local and provide PostHog keys. Verify PostHog initializes and sends events in dev mode.

Open in Cursor Open in Web

Copy link

cursor bot commented Sep 10, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

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