-
Notifications
You must be signed in to change notification settings - Fork 408
Revert back to prevent raising exception when there's no active session #9794
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…checks and conditional logic to prevent errors when stopping and applying updates.
…d and update tests to handle session state without exceptions.
…ProjectHotReloadSession.cs
….Commands in ProjectHotReloadSessionTests.cs
tmat
approved these changes
Sep 29, 2025
Member
tmat
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving only as a temporary fix until https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2581474 is addressed.
Needs to be reverted afterwards.
phenning
approved these changes
Sep 29, 2025
LittleLittleCloud
added a commit
that referenced
this pull request
Sep 30, 2025
…on (#9794) * Improve session management in ProjectHotReloadSession by adding null checks and conditional logic to prevent errors when stopping and applying updates. * Refactor ProjectHotReloadSession to remove RequireActiveSession method and update tests to handle session state without exceptions. * add comment * Remove unused using directive for System.Diagnostics.CodeAnalysis in ProjectHotReloadSession.cs * Remove unused using directive for Microsoft.VisualStudio.RpcContracts.Commands in ProjectHotReloadSessionTests.cs
LittleLittleCloud
added a commit
that referenced
this pull request
Sep 30, 2025
…on (#9794) (#9797) * Improve session management in ProjectHotReloadSession by adding null checks and conditional logic to prevent errors when stopping and applying updates. * Refactor ProjectHotReloadSession to remove RequireActiveSession method and update tests to handle session state without exceptions. * add comment * Remove unused using directive for System.Diagnostics.CodeAnalysis in ProjectHotReloadSession.cs * Remove unused using directive for Microsoft.VisualStudio.RpcContracts.Commands in ProjectHotReloadSessionTests.cs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR remove the stricter check for whether session active or not when hotreload agent's applyChange method get called.
Usually, the appplyChange method should only be invoked by debugger when there's active debugger session in the IDE, however, in reality, debugger might also call that applyChange method in some situations, like restarting app because of rude edits, which crashes VS if applyChange raise exceptions.
This PR performs a temporary fix to switch to a softer validation check when applyChange get called in the wrong time: leaving a tracing message in hotreload channel and silently return. In the future, a more thorough fix would be on the debugger side to avoid apply change when there's no active session.
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2581474/