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

Adding policy requires a restart of vs code to apply #244531

Closed
joshspicer opened this issue Mar 25, 2025 · 9 comments · Fixed by #244735 or #244996
Closed

Adding policy requires a restart of vs code to apply #244531

joshspicer opened this issue Mar 25, 2025 · 9 comments · Fixed by #244735 or #244996
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release config VS Code configuration, set up issues insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Milestone

Comments

@joshspicer
Copy link
Member

joshspicer commented Mar 25, 2025

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.99
  • OS Version: macOS/windows

Similar to microsoft/vscode-policy-watcher#47 but the issue is in core instead of this policy-watcher.

Steps to Reproduce:

  1. Ensure you have NO configuration profiles installed for VS Code
  2. Open Insiders
  3. Add a configuration profile with any policy that is currently supported
  4. 🐛 policy is not applied until a relaunch of VS Code
Copy link

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.98.2. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

@joshspicer joshspicer changed the title Policy does not refresh when removed Policy requires a restart of vs code to apply Mar 25, 2025
@sandy081 sandy081 added this to the March 2025 milestone Mar 26, 2025
@sandy081
Copy link
Member

Seems to be a regression caused by MultiplexePolicyService

@sandy081 sandy081 added bug Issue identified by VS Code Team member as probable bug config VS Code configuration, set up issues labels Mar 26, 2025
sandy081 added a commit that referenced this issue Mar 26, 2025
sandy081 added a commit that referenced this issue Mar 26, 2025
@vs-code-engineering vs-code-engineering bot added the unreleased Patch has not yet been released in VS Code Insiders label Mar 26, 2025
@joshspicer
Copy link
Member Author

I thought i'd noticed this behavior earlier in the month (before the multiplex changes landed).

When the change lands it is probably worth testing on linux (where we wouldn't instantiate a multiplexpolicyservice, just an accountpolicyservice)

@vs-code-engineering vs-code-engineering bot added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Mar 27, 2025
@joshspicer joshspicer added the verification-found Issue verification failed label Mar 27, 2025
@joshspicer
Copy link
Member Author

Demo of this repro'ing on macOS in today's insiders (ff52a0d):

Screen.Recording.2025-03-27.at.2.44.09.PM.mov

The underlying native policy watcher does pick up changes instantly, so the issue appears to be in vscode itself:

Screen.Recording.2025-03-27.at.2.46.38.PM.mov

@joshspicer joshspicer reopened this Mar 27, 2025
@vs-code-engineering vs-code-engineering bot removed the insiders-released Patch has been released in VS Code Insiders label Mar 27, 2025
@sandy081
Copy link
Member

@joshspicer It is not easy to follow the video. Can you please share the steps to reproduce? Please also share the trace logs from main and window which contain information about policy changes.

Also, looks like chat related policies will be always overridden by the account policy right?

@joshspicer
Copy link
Member Author

joshspicer commented Mar 28, 2025

  1. Ensure you have NO configuration profiles installed for VS Code
  2. Open Insiders
  3. Add a configuration profile with any policy that is currently supported (I randomly chose the chat-related policies, any policy will do and the ones I chose are not relevant)
  4. 🐛 policy is not applied until a relaunch of VS Code

@joshspicer
Copy link
Member Author

This issue does not repro when using the FilePolicyService in place of NativePolicyService

Screen.Recording.2025-03-28.at.10.08.30.AM.mov

@joshspicer joshspicer changed the title Policy requires a restart of vs code to apply Adding policy requires a restart of vs code to apply Mar 28, 2025
@joshspicer joshspicer added candidate Issue identified as probable candidate for fixing in the next release and removed verification-found Issue verification failed labels Mar 28, 2025
@joshspicer
Copy link
Member Author

joshspicer commented Mar 28, 2025

Fix: #244996

This bug has been here for a while, but I think it went under the radar due to the lack of policies that existed. This month we have many more policies contributed from many places, and therefore the bug is more pronounced.


This is consistently the final "update" I've observed under the debugger, therefore (before the fix) only that one policy would have been watched by the native policy watcher

Image

@TylerLeonhardt
Copy link
Member

/closedWith 99c9c6c

@vs-code-engineering vs-code-engineering bot added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Mar 28, 2025
@rzhao271 rzhao271 added the verified Verification succeeded label Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release config VS Code configuration, set up issues insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Projects
None yet
4 participants