Repository navigation
fix: Analytics plugin - #2624
creeperkatze wants to merge 2 commits into
Conversation
✅ Deploy Preview for creative-fairy-df92c4 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Once |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe analytics background plugin now dynamically imports ChangesAnalytics runtime guard
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: 🔵 Low · up to Background analytics may miss an install or update event if it arrives before the provider is ready. This is a limited reporting gap; the change remains mergeable with awareness of the potential telemetry loss. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
This changes the setup from a synchronous import to a dynamic one. I don't want to do that.
The "correct" change is to add the abilitiy to choose which entrypoints a plugin runs in. That's a bigger change, but one I've been meaning to make for a while. If you want to take a crack at it, please do.
|
Looks like someone has already opened a PR to allow filtering which entrypoints a plugin is loaded into. |
|
Closing in favor of #2613 |

Overview
The analytics plugin ran in every entrypoint, including MAIN-world content scripts without
browser.runtimeaccess. It imported#analyticsat the top of the file, socreateAnalytics()threw during module load and crashed the entrypoint before its own code ran. Now the import is dynamic and guarded by abrowser.runtime.idcheck, so it's skipped where there's no runtime access instead of crashing.Manual Testing
Added a MAIN-world content script next to the analytics module and confirmed it no longer crashes, while analytics still works in the background, popup, and isolated content scripts.
Related Issue
This PR closes #1847