Skip to content

feat/sentry user implementation#910

Open
egelhaus wants to merge 18 commits into
mainfrom
sentry-user
Open

feat/sentry user implementation#910
egelhaus wants to merge 18 commits into
mainfrom
sentry-user

Conversation

@egelhaus
Copy link
Copy Markdown
Collaborator

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;

  • I have read the CONTRIBUTING guide.
  • I checked that there were not similar issues or PRs already open for this.
  • This PR fixes just ONE issue (do not include multiple issues or types of change in the same PR) For example, don't try and fix a UI issue and include new dependencies in the same PR.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jul 31, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
postiz-app-test Error Error Mar 21, 2026 5:00pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
postiz Ignored Ignored Mar 21, 2026 5:00pm

Request Review

@egelhaus egelhaus requested a review from Copilot July 31, 2025 20:09

This comment was marked as outdated.

egelhaus and others added 5 commits July 31, 2025 22:10
…t.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…t.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@egelhaus egelhaus marked this pull request as ready for review August 1, 2025 09:29
@egelhaus egelhaus requested a review from Copilot August 1, 2025 12:51
Copy link
Copy Markdown
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 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

Comment thread libraries/nestjs-libraries/src/sentry/sentry.user.context.ts
Comment thread libraries/nestjs-libraries/src/sentry/sentry.user.context.ts
Comment thread libraries/nestjs-libraries/src/sentry/sentry.user.context.ts Outdated
Comment thread libraries/nestjs-libraries/src/sentry/sentry.user.context.ts Outdated
Comment thread libraries/nestjs-libraries/src/sentry/sentry.user.context.ts Outdated
Comment thread apps/frontend/src/components/layout/user.context.tsx Outdated
Comment thread apps/frontend/src/components/layout/user.context.tsx Outdated
@github-actions
Copy link
Copy Markdown

This PR is stale because it has been open for 90 days with no activity.

@github-actions github-actions Bot added the stale label Oct 30, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Nov 6, 2025

This PR was closed because it has been inactive for 7 days since being marked as stale.

@github-actions github-actions Bot closed this Nov 6, 2025
@egelhaus egelhaus reopened this Nov 11, 2025
@egelhaus
Copy link
Copy Markdown
Collaborator Author

@copilot do you have any improvements for this PR?

Copy link
Copy Markdown

Copilot AI commented Nov 24, 2025

@egelhaus I've opened a new pull request, #1076, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits November 24, 2025 21:41
…cumentation

Co-authored-by: egelhaus <156946629+egelhaus@users.noreply.github.com>
Co-authored-by: egelhaus <156946629+egelhaus@users.noreply.github.com>
feat: Sentry user context integration with error handling
@egelhaus
Copy link
Copy Markdown
Collaborator Author

@sentry review

Comment thread libraries/nestjs-libraries/src/sentry/sentry.user.context.ts
Comment thread libraries/react-shared-libraries/src/sentry/sentry.user.context.ts
Comment thread apps/frontend/src/components/layout/logout.component.tsx
Comment thread libraries/nestjs-libraries/src/sentry/sentry.user.context.ts
@egelhaus
Copy link
Copy Markdown
Collaborator Author

After testing the system carefully, it seems to work.
Error Event:
image

Trace Event (Backend):
image

Metric Event:
image

Profile Event:
image

Replay Event:
image

Comment out the Sentry DSN variable in the example file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants