Skip to content
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

ISentryUserFactory doesn't work unless it also implements the obsolete IUserFactory interface #2844

Closed
ian-a-anderson opened this issue Nov 15, 2023 · 3 comments
Labels
Bug Something isn't working

Comments

@ian-a-anderson
Copy link

Package

Sentry.AspNetCore

.NET Flavor

.NET

.NET Version

6.0.0

OS

Linux

SDK Version

3.40.1

Self-Hosted Sentry Version

No response

Steps to Reproduce

  1. Sentry currently warns against using IUserFactory and recommends users switch to ISentryUserFactory:
image
  1. However, if you only implement and register ISentryUserFactory your custom code is never hit, because Sentry itself only looks for the obsolete IUserFactory implementation:
    var userFactory = context.RequestServices.GetService<IUserFactory>();
image

Expected Result

Implementing and registering ISentryUserFactory should work without having to continue implementing the obsolete IUserFactory interface.

Actual Result

No custom user code is hit when running with only a ISentryUserFactory implementation registered.

In order to allow users to transition away from IUserFactory, the underlying code in ScopeExtensions should look for implementations of ISentryUserFactory and reference them if registered.

@bitsandfoxes
Copy link
Contributor

Thanks for raising this @ian-a-anderson. A fix is on its way.

@ian-a-anderson
Copy link
Author

Thanks for raising this @ian-a-anderson. A fix is on its way.
Just to confirm, is the fix coming in the v3.40 codebase or only with v4?

@vaind
Copy link
Collaborator

vaind commented Nov 17, 2023

Thanks for raising this @ian-a-anderson. A fix is on its way.
Just to confirm, is the fix coming in the v3.40 codebase or only with v4?

v4.0.0 - #2840

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

3 participants