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

Fix Restoring the Original Activity Parent #48034

Merged
merged 2 commits into from
Feb 10, 2021

Conversation

tarekgh
Copy link
Member

@tarekgh tarekgh commented Feb 9, 2021

Fixes #46721

When creating and starting an Activity object with a parent context the stopping this activity, we used not caring about the Activity.Current at that time. When stopping such Activity, we don't restore any parent to Activity.Current and instead we store null.
The change here is to restore the original value of Activity.Current before we started the Activity.

Copy link
Member

@noahfalk noahfalk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggested a few simplifications inline (primarily because I was wrong earlier when we talked, sorry about that). Other than that, looks good!

@tarekgh tarekgh merged commit bbb4b0c into dotnet:master Feb 10, 2021
@tarekgh tarekgh deleted the FixRestoringParentActivity branch February 10, 2021 22:46
@ghost ghost locked as resolved and limited conversation to collaborators Mar 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ending an activity will not restore the previously active one for explicit parents
2 participants