Skip to content

Conversation

@aiktb
Copy link
Owner

@aiktb aiktb commented Sep 13, 2025

No description provided.

Copilot AI review requested due to automatic review settings September 13, 2025 10:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR integrates Sentry error tracking into the browser extension, enabling error monitoring and reporting in both the popup and options pages.

  • Adds Sentry configuration and initialization to both entry points
  • Includes Sentry Vite plugin for build-time integration with sourcemap support
  • Adds a test button in the options page to verify error tracking functionality

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 5 comments.

File Description
apps/extension/wxt.config.ts Configures Sentry Vite plugin and enables sourcemap generation
apps/extension/src/entrypoints/popup/main.tsx Initializes Sentry for popup entry point
apps/extension/src/entrypoints/options/main.tsx Initializes Sentry for options entry point and adds error test button
apps/extension/package.json Adds Sentry React and Vite plugin dependencies
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +41 to +42
"@sentry/react": "^10.11.0",
"@sentry/vite-plugin": "^4.3.0",
Copy link

Copilot AI Sep 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sentry packages should be in dependencies, not devDependencies, since they are runtime dependencies needed in production builds.

Copilot uses AI. Check for mistakes.
import { Root } from "./root";

Sentry.init({
dsn: "https://93bfaefbe956cf67fc9baad45d9c8357@o4507553809498112.ingest.us.sentry.io/4508510108319744",
Copy link

Copilot AI Sep 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Sentry DSN contains sensitive configuration data and should be moved to an environment variable instead of being hardcoded.

Suggested change
dsn: "https://93bfaefbe956cf67fc9baad45d9c8357@o4507553809498112.ingest.us.sentry.io/4508510108319744",
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,

Copilot uses AI. Check for mistakes.
]);

Sentry.init({
dsn: "https://93bfaefbe956cf67fc9baad45d9c8357@o4507553809498112.ingest.us.sentry.io/4508510108319744",
Copy link

Copilot AI Sep 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Sentry DSN contains sensitive configuration data and should be moved to an environment variable instead of being hardcoded.

Suggested change
dsn: "https://93bfaefbe956cf67fc9baad45d9c8357@o4507553809498112.ingest.us.sentry.io/4508510108319744",
dsn: import.meta.env.VITE_SENTRY_DSN,

Copilot uses AI. Check for mistakes.
Comment on lines +49 to +56
<button
className="fixed top-4 right-4 z-50 rounded-full bg-red-500 px-4 py-2 text-white transition hover:bg-red-600"
onClick={() => {
throw new Error("This is your first error!");
}}
>
Break the world
</button>
Copy link

Copilot AI Sep 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test button for error tracking should be removed before production deployment or wrapped in a development-only condition.

Suggested change
<button
className="fixed top-4 right-4 z-50 rounded-full bg-red-500 px-4 py-2 text-white transition hover:bg-red-600"
onClick={() => {
throw new Error("This is your first error!");
}}
>
Break the world
</button>
{import.meta.env.DEV && (
<button
className="fixed top-4 right-4 z-50 rounded-full bg-red-500 px-4 py-2 text-white transition hover:bg-red-600"
onClick={() => {
throw new Error("This is your first error!");
}}
>
Break the world
</button>
)}

Copilot uses AI. Check for mistakes.
Comment on lines +11 to +16
Sentry.init({
dsn: "https://93bfaefbe956cf67fc9baad45d9c8357@o4507553809498112.ingest.us.sentry.io/4508510108319744",
// Setting this option to true will send default PII data to Sentry.
// For example, automatic IP address collection on events
sendDefaultPii: true,
});
Copy link

Copilot AI Sep 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sentry configuration is duplicated between popup and options entry points. Consider creating a shared configuration module to avoid code duplication.

Copilot uses AI. Check for mistakes.
@cloudflare-workers-and-pages
Copy link

Deploying furigana-maker with  Cloudflare Pages  Cloudflare Pages

Latest commit: 190a814
Status: ✅  Deploy successful!
Preview URL: https://d237f400.furiganamaker.pages.dev
Branch Preview URL: https://feat-sentry.furiganamaker.pages.dev

View logs

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