-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
feat/sentry user implementation #910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
…t.ts Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…t.ts Co-authored-by: Copilot <[email protected]>
There was a problem hiding this 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 implements Sentry user context integration across the Postiz monorepo to enhance error tracking by associating user information with Sentry events. The implementation provides automatic user context setting in both frontend and backend services.
- Adds user context utilities for both React (frontend) and NestJS (backend) environments
- Integrates automatic user context setting in authentication middleware and user components
- Ensures proper cleanup of user context during logout operations
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
File | Description |
---|---|
libraries/react-shared-libraries/src/sentry/sentry.user.context.ts |
Frontend utility functions for setting and clearing Sentry user context with custom UserInfo interface |
libraries/nestjs-libraries/src/sentry/sentry.user.interceptor.ts |
NestJS interceptor for automatic user context setting on requests |
libraries/nestjs-libraries/src/sentry/sentry.user.context.ts |
Backend utility functions using Prisma User model for Sentry context |
apps/frontend/src/components/layout/user.context.tsx |
Integration of Sentry user context in React user context provider |
apps/frontend/src/components/layout/logout.component.tsx |
Clear Sentry context during frontend logout |
apps/backend/src/services/auth/auth.middleware.ts |
Set/clear Sentry context during authentication middleware |
apps/backend/src/api/routes/users.controller.ts |
Clear Sentry context during backend logout endpoint |
Sentry.setTag('user.activated', null); | ||
Sentry.setTag('user.provider', null); | ||
Sentry.setTag('user.super_admin', null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting tags to null may not properly clear them in Sentry. Consider using empty strings or calling Sentry.removeTag() if available, to ensure tags are properly cleared.
Sentry.setTag('user.activated', null); | |
Sentry.setTag('user.provider', null); | |
Sentry.setTag('user.super_admin', null); | |
Sentry.setTag('user.activated', ''); | |
Sentry.setTag('user.provider', ''); | |
Sentry.setTag('user.super_admin', ''); |
Copilot uses AI. Check for mistakes.
What kind of change does this PR introduce?
eg: Bug fix, feature, docs update, ...
Why was this change needed?
Please link to related issues when possible, and explain WHY you changed things, not WHAT you changed.
Other information:
eg: Did you discuss this change with anybody before working on it (not required, but can be a good idea for bigger changes). Any plans for the future, etc?
Checklist:
Put a "X" in the boxes below to indicate you have followed the checklist;