microsoft/vscode-mssql

Results Panel not Refreshing Automatically

bijuchacko opened this issue · 6 comments

  • MSSQL Extension Version: 0.2.0
  • VSCode Version: 1.9.0
  • OS Version: Windows 10

Just upgraded to stable version 1.9.0 and noticed that the results panel does not refresh automatically every time I run the query. It used to work fine with the previous version of VSCode.

Steps to Reproduce:

  1. Execute a query
  2. Modify the query and run again, the results pane will not automatically refresh with the results for the modified query.

We've discovered this ourselves - this is due to a breaking change in VSCode. See microsoft/vscode#19732 for the tracking issue there. We are actively investigating a workaround in our own extension code so that we can release a hotfix version and unblock users.

I would recommend you adding your voice to the VSCode issue also - this will help get this raised as a breaking change that is impacting users.

@bijuchacko we (the VS Code team is definitly listening). Thanks for the reproducable steps, we will look into this.

@kevcunnane @egamma Thanks for the prompt response. I have downgraded to 1.8.1, thank you so much for this awesome editor and extension!

We've traced the issue on our side and have a fix that we'll be able to apply as an extension update.

HotFix information
Ensure that TextDocumentContentProvider.provideTextDocumentContent always provides an updated string when being refreshed.

Root cause
We implement TextDocumentContentProvider to represent our results. This expects you to fire an onDidChange event whenever you want to refresh your content, which then requests the updated document contents by calling your provideTextDocumentContent method.

  • We always return the same string, which kicks off our mini HTML app
  • In VSCode 1.9.0, it does a string comparison and only refreshes the page if the content is different
  • A short term fix is therefore to change the content so that it detects a difference and refreshes the document

Long term fix on our side
We can handle this better on our side - currently we call resetSocket to kill the current WebSocket communications channel and then do a full refresh. If there's a document open & visible already, we should instead sent a "reset" event so it clears its current state and then processes the new data instead. However this will take time to implement so skipping for now.

@bijuchacko @egamma - The fix for this is now released as version 0.2.1. If you update MSSQL from the Extensions tab you should no longer see this issue. Thank you for raising this and I hope you enjoy using our extension inside VSCode 1.9.0 now this issue is resolved.

@kevcunnane great 🌹