Skip to content

fix(analytics): remove dev-only debug mode - #486

Merged
leoisadev1 merged 2 commits into
mainfrom
fix/remove-analytics-dev-mode
Jan 6, 2026
Merged

fix(analytics): remove dev-only debug mode#486
leoisadev1 merged 2 commits into
mainfrom
fix/remove-analytics-dev-mode

Conversation

@leoisadev1

Copy link
Copy Markdown
Member

Removes the conditional dev/prod logic for OneDollarStats. Now uses the same script in all environments.

@railway-app

railway-app Bot commented Jan 6, 2026

Copy link
Copy Markdown

🚅 Deployed to the openchat-pr-486 environment in OpenChat

Service Status Web Updated (UTC)
web 🕒 Building (View Logs) Web Jan 6, 2026 at 11:30 pm

@railway-app
railway-app Bot temporarily deployed to OpenChat / openchat-pr-486 January 6, 2026 23:27 Destroyed
@github-actions

github-actions Bot commented Jan 6, 2026

Copy link
Copy Markdown
Contributor

🚀 Preview Deployment Ready

Environment URL
Frontend https://web-openchat-pr-486.up.railway.app
Convex Dashboard Dashboard

Convex Preview Backend

  • Cloud URL: https://fastidious-porcupine-645.convex.cloud
  • Site URL: https://fastidious-porcupine-645.convex.site

🤖 Deployed automatically by GitHub Actions

@greptile-apps

greptile-apps Bot commented Jan 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR removes the conditional environment logic for OneDollarStats analytics script. Previously, the script loaded with a data-debug="osschat.dev" attribute in development mode and without it in production. Now it uses the same configuration across all environments, loading the script without the debug attribute.

Key changes:

  • Removed import.meta.env.DEV conditional branching
  • Eliminated data-debug="osschat.dev" attribute from development builds
  • Unified analytics tracking configuration across dev and production environments

Impact:
Development environment analytics will now be tracked alongside production data, which may affect analytics accuracy if local development traffic is significant. Consider whether development events should be filtered at the analytics dashboard level if needed.

Confidence Score: 5/5

  • This PR is safe to merge with no risk - it's a simple configuration change with no functional impact
  • The change removes conditional logic for an analytics script attribute, which has no impact on application functionality. The code is syntactically correct, properly formatted, and the simplification improves maintainability. No runtime errors, security issues, or logical problems introduced.
  • No files require special attention

Important Files Changed

Filename Overview
apps/web/src/routes/__root.tsx Removed conditional dev/prod logic for OneDollarStats script, now uses single script tag without debug attribute in all environments

Sequence Diagram

sequenceDiagram
    participant User
    participant Browser
    participant Root as __root.tsx
    participant OneDollar as OneDollarStats Script
    
    User->>Browser: Navigate to app
    Browser->>Root: Render root route
    Root->>Root: Execute head() function
    Note over Root: Generate meta tags, links, scripts
    Root->>Browser: Return head config with scripts array
    Browser->>Browser: Parse scripts configuration
    Browser->>OneDollar: Load stonks.js (deferred)
    Note over OneDollar: Script loads without data-debug attribute<br/>(same behavior in dev and prod)
    OneDollar->>OneDollar: Initialize analytics tracking
    Browser->>User: App renders with analytics enabled
Loading

@railway-app
railway-app Bot temporarily deployed to OpenChat / openchat-pr-486 January 6, 2026 23:30 Destroyed
@leoisadev1
leoisadev1 merged commit 10f0b30 into main Jan 6, 2026
5 checks passed
@leoisadev1
leoisadev1 deleted the fix/remove-analytics-dev-mode branch January 6, 2026 23:31
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