Skip to content

Conversation

areibman
Copy link
Contributor

📥 Pull Request

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

  • Disabling PostHog initialization unless a key is present and the environment is not development or local.
  • Adding checks to PostHogUserIdentifier to only interact with PostHog if it's loaded.
  • Skipping /opsboard/users/me API calls when no session_id cookie is present in both useUser and the sign-in form.
  • Reducing console logging for expected 401/403 authentication errors in non-production environments.

These changes prevent unnecessary network requests and console spam (e.g., 401/404 errors, JSON MIME errors) when working locally without a fully configured backend or analytics.

🧪 Testing
I ran the application locally and verified the following:

  • PostHog-related 401/404 errors and JSON MIME errors are no longer present in the console.
  • /opsboard/users/me calls are not made when no session_id cookie exists.
  • Expected 401/403 API errors are now logged as warnings or suppressed in local mode, rather than noisy console errors.
  • Authentication and user fetching still function correctly when a valid session is present.

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