Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@fingerprintjs/fingerprintjs": "^5.0.1",
"@mdi/font": "7.4.47",
"@microsoft/clarity": "^1.0.2",
"@sentry/vue": "^10.36.0",
Copy link

Copilot AI Jan 24, 2026

Choose a reason for hiding this comment

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

This PR adds a new dependency but doesn’t update the lockfile (the repo contains pnpm-lock.yaml). Please regenerate and commit the lockfile so installs/CI are reproducible.

Suggested change
"@sentry/vue": "^10.36.0",

Copilot uses AI. Check for mistakes.
"@vueuse/core": "^14.1.0",
"axios": "^1.13.2",
"idb": "^8.0.3",
Expand Down
24 changes: 24 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// Plugins
import {registerPlugins} from '@/plugins'
import {createPinia} from 'pinia'
import router from './router'

const pinia = createPinia()

Expand All @@ -23,8 +24,31 @@ import {createApp} from 'vue'
import messageService from './utils/message';
import { getVisitorId } from './utils/visitorId';

import * as Sentry from "@sentry/vue";

const app = createApp(App)

Sentry.init({
app,
dsn: "https://2f8e5e4ec986c6077d3798ba9f683fdd@o4510762489151488.ingest.us.sentry.io/4510762503438336",
Copy link

Copilot AI Jan 24, 2026

Choose a reason for hiding this comment

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

The Sentry DSN is hard-coded in source. Please load it from an environment variable (e.g., import.meta.env.VITE_SENTRY_DSN) and consider skipping Sentry.init (or setting enabled: false) when the DSN isn’t provided, so different environments/forks don’t report into the same Sentry project.

Copilot uses AI. Check for mistakes.
// Setting this option to true will send default PII data to Sentry.
// For example, automatic IP address collection on events
sendDefaultPii: true,
Comment on lines +31 to +36
Copy link

Copilot AI Jan 24, 2026

Choose a reason for hiding this comment

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

sendDefaultPii: true enables sending default PII to Sentry. This should be gated via environment/config (and ideally user consent) so production builds can disable it when required.

Suggested change
Sentry.init({
app,
dsn: "https://2f8e5e4ec986c6077d3798ba9f683fdd@o4510762489151488.ingest.us.sentry.io/4510762503438336",
// Setting this option to true will send default PII data to Sentry.
// For example, automatic IP address collection on events
sendDefaultPii: true,
const enableDefaultPii =
typeof process !== 'undefined' &&
process.env &&
process.env.VUE_APP_SENTRY_SEND_DEFAULT_PII === 'true';
Sentry.init({
app,
dsn: "https://2f8e5e4ec986c6077d3798ba9f683fdd@o4510762489151488.ingest.us.sentry.io/4510762503438336",
// Setting this option to true will send default PII data to Sentry.
// For example, automatic IP address collection on events
// Controlled via the VUE_APP_SENTRY_SEND_DEFAULT_PII environment variable.
sendDefaultPii: enableDefaultPii,

Copilot uses AI. Check for mistakes.
integrations: [
Sentry.browserTracingIntegration({ router }),
Sentry.replayIntegration()
],
// Tracing
tracesSampleRate: 1.0, // Capture 100% of the transactions
// Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
Comment on lines +42 to +43
Copy link

Copilot AI Jan 24, 2026

Choose a reason for hiding this comment

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

tracesSampleRate: 1.0 captures 100% of transactions and can create significant overhead/cost in production. Consider making this environment-based (or using tracesSampler) so production can sample at a lower rate.

Copilot uses AI. Check for mistakes.
tracePropagationTargets: ["localhost", /^https:\/\/kv-service\.(houlang\.cloud|wuyuan\.dev)/],
// Session Replay
replaysSessionSampleRate: 0.01, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
Copy link

Copilot AI Jan 24, 2026

Choose a reason for hiding this comment

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

The replaysSessionSampleRate value (0.01 = 1%) doesn’t match the comment saying 10%. Please either update the value to 0.1 or fix the comment to reflect the intended sampling rate.

Suggested change
replaysSessionSampleRate: 0.01, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
replaysSessionSampleRate: 0.01, // This sets the sample rate at 1%. You may want to change it to 100% while in development and then sample at a lower rate in production.

Copilot uses AI. Check for mistakes.
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
// Logs
enableLogs: true
Comment on lines +48 to +49
Copy link

Copilot AI Jan 24, 2026

Choose a reason for hiding this comment

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

enableLogs: true will increase data volume and may capture sensitive information depending on what gets logged. Please make this configurable per environment (and/or add scrubbing) so production can disable it if needed.

Copilot uses AI. Check for mistakes.
});

registerPlugins(app)
//app.use(TDesign)
app.use(messageService);
Expand Down
Loading