-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
Secrets store onDidChange
does not fire in the window where the update was made in VS Code 1.8.0
#187247
Comments
onDidChange
is not firing on VS Code InsidersonDidChange
is not firing in VS Code 1.8.0
onDidChange
is not firing in VS Code 1.8.0onDidChange
does not fire in the window where the update was made in VS Code 1.8.0
Thanks for calling this out. I originally did this because you already have the secret you're storing in the window you're storing it in... but this is changed behavior so I'll change it back. We'll also include it in the 1.80 recovery which will be next week. |
Cool, thank you! Yeah, in our case we are doing something in response to the secret changing, so with the current behaviour we have to have both a change listener (for other windows), and a manual call to the listener (for the active window). |
Hi! We're having the same problem in our extension . |
Closing this since the PR is merged and it'll be in 1.80.1 |
Hey @BeFunes - I just mean something like:
|
Verification in Stable candidate:
in 1.80.0, you would only see it in the window that you didn't run the command in. |
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
console.log
when there is a change (for example), usingcontext.secrets.onDidChange
.context.secrets.store
Expected behaviour:
The change listener should fire and the log message will be seen in both the current VS Code window, and any other VS Code windows which are open where the extension is running
Actual behaviour:
In VS Code 1.8.0 (and also Insiders and VS Code built from source from the latest
main
), theonDidChange
listener never fires in the window where the update was made. It does fire in other windows.In 1.79.2, the listener would fire in the instance where the update was made. It seems the behaviour changed in #185077, specifically the change listener is paused when storing the secret.
It may be that this is a deliberate change, in which case it should be documented, but it seems somewhat surprising/a bit of a regression to me, as now you need to make sure you manually invoke any secret store change handlers in addition to using a listener.
This broke some functionality in our extension which was working in 1.79.2, the workaround is just to call the change handler manually at the point of updating the secret store, but this means you have to remember to do this in multiple places potentially and breaks my expectations around how the listener would work.
Repro:
This example extension provides a minimal repro of the bug: https://github.com/tomduncalf-figma/vscode-insiders-secrets-ondidchange-bug. Running the extension and triggering the "Hello World" command will log
Secrets changed
in the regular VS Code build, but will not log anything in Insiders.The text was updated successfully, but these errors were encountered: