GithubHelp home page GithubHelp logo

Comments (3)

JustusGreiberORGADATA avatar JustusGreiberORGADATA commented on June 2, 2024 1

@AndersAbel Yeah I agree, the ID should be null, if Activity.Current was null at the time of creation. It should not magically appear later after deserialization.

But if custom code creates an ErrorMessage it now needs to be updated to include setting the ActivityId.

I don't have any code like that. I doubt it is a common use case.

from identityserver.

AndersAbel avatar AndersAbel commented on June 2, 2024

It makes perfect sense to include Activity.Current?.Id in ErrorMessage.

The Events are being phased out in favour of the new open telemetry compatible activities/logs/metrics.

from identityserver.

AndersAbel avatar AndersAbel commented on June 2, 2024

@JustusGreiberORGADATA I've now implemented this and submitted a PR. I first tried using your suggestion:

public string? ActivtityId { get; set; } = Activity.Current?.Id;

However, this had one problem if there is no Current activity in the ErrorMessage that is serialized. Then the deserializer will not write the property at all (because it's null in the payload). That will leave the default value in the object created to receive the values of the deserializer. The end result was that if there was no current activity when the error message was created, the activity Id of when the error was displayed/used would be used on the ErrorMessage. I would expect that if a null activity was passed in to serialization, then a null activity would be read back too.

The more straight forward solution is to let the creator of the ErrorMessage initialize the ActivityId. In IdentityServer that is only done in one place in the AuthorizeHttpWriter. But if custom code creates an ErrorMessage it now needs to be updated to include setting the ActivityId.

from identityserver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.