Skip to content

Conversation

@egelhaus
Copy link
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

vercel bot commented Jul 31, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
postiz ⬜️ Ignored (Inspect) Aug 1, 2025 1:00pm

@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

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 on lines +52 to +54
Sentry.setTag('user.activated', null);
Sentry.setTag('user.provider', null);
Sentry.setTag('user.super_admin', null);
Copy link

Copilot AI Aug 1, 2025

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.

Suggested change
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.
@github-actions
Copy link

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

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
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.

2 participants