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

Restore dialog broken #23257

Closed
Charles-Gagnon opened this issue May 30, 2023 · 5 comments
Closed

Restore dialog broken #23257

Charles-Gagnon opened this issue May 30, 2023 · 5 comments

Comments

@Charles-Gagnon
Copy link
Contributor

1.44/Insiders

Same issue as #22839, which was fixed in #22840

The problem was reintroduced in #23104

I had added a test in the original fix that would have caught this, but unfortunately that was removed in a later PR that reverted the entire original feature : https://github.com/microsoft/azuredatastudio/pull/22997/files#diff-1f7cb57d04746810c6a813556ea08b667478f91cb7598f607d819cbe155d805eL287

@kburtram
Copy link
Member

In my test environment I am able to open the restore dialog from the Manage dashboard, as a workaround. I get the below exception when launching from OE.

log.ts:313   ERR this.getOptionKeyIdNames is not a function: TypeError: this.getOptionKeyIdNames is not a function
    at Object.getOptionsKey (vscode-file://vscode-app/c:/Users/karlb/AppData/Local/Programs/Azure%20Data%20Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:165:5857)
    at Object.getOptionsKey (vscode-file://vscode-app/c:/Users/karlb/AppData/Local/Programs/Azure%20Data%20Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:165:11379)
    at d (vscode-file://vscode-app/c:/Users/karlb/AppData/Local/Programs/Azure%20Data%20Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:42:10543)
    at Object.b [as generateUri] (vscode-file://vscode-app/c:/Users/karlb/AppData/Local/Programs/Azure%20Data%20Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:42:10356)
    at wa.getConnectionUri (vscode-file://vscode-app/c:/Users/karlb/AppData/Local/Programs/Azure%20Data%20Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:2710:27599)
    at vscode-file://vscode-app/c:/Users/karlb/AppData/Local/Programs/Azure%20Data%20Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:2480:31836
    at new ZoneAwarePromise (C:\Users\karlb\AppData\Local\Programs\Azure Data Studio\resources\app\node_modules.asar\zone.js\dist\zone.js:1351:25)
    at u.showDialog (vscode-file://vscode-app/c:/Users/karlb/AppData/Local/Programs/Azure%20Data%20Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:2480:31771)
    at o (vscode-file://vscode-app/c:/Users/karlb/AppData/Local/Programs/Azure%20Data%20Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:2224:1220)
    at d.invokeFunction (vscode-file://vscode-app/c:/Users/karlb/AppData/Local/Programs/Azure%20Data%20Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:890:325)
    at s.runTask (vscode-file://vscode-app/c:/Users/karlb/AppData/Local/Programs/Azure%20Data%20Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:2224:2173)
    at handler (vscode-file://vscode-app/c:/Users/karlb/AppData/Local/Programs/Azure%20Data%20Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:1234:23683)
    at d.invokeFunction (vscode-file://vscode-app/c:/Users/karlb/AppData/Local/Programs/Azure%20Data%20Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:890:325)
    at d._tryExecuteCommand (vscode-file://vscode-app/c:/Users/karlb/AppData/Local/Programs/Azure%20Data%20Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:2433:3665)
    at d.executeCommand (vscode-file://vscode-app/c:/Users/karlb/AppData/Local/Programs/Azure%20Data%20Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:2433:3022)
    at handler (vscode-file://vscode-app/c:/Users/karlb/AppData/Local/Programs/Azure%20Data%20Studio/resources/app/out/vs/workbench/workbench.desktop.main.js:2224:3505)

@cheenamalhotra
Copy link
Member

cheenamalhotra commented May 30, 2023

The only change in the linked PR was to move a part of function in a separate function. Adding the moved code to original function seems to resolve the error (but we also need the new function for commanLine use, so code would be duplicated.. we should look for a better solution long term).

The issue seems that the new function is not available when called from OE.. Does it mean OE is casting to a base type and is hiding functionalities from original type?

We should also a test case that tests both types function list is identical (if that's intended) and not just the options key - as they are not interchangeable. We aren't able to add any new functions (private also doesn't work) to ProviderConnectionInfo independently until this design is fixed, otherwise we would continue facing this kind of issue from any part of the application.

@kburtram kburtram self-assigned this May 30, 2023
@Charles-Gagnon
Copy link
Contributor Author

@cheenamalhotra The issue was caused by this line : https://github.com/microsoft/azuredatastudio/pull/23104/files#diff-f952231bc3fde12d411ad32e4e9fd058ae7127e1516fb230e077106f55fe858fR205

See the original PR for why this breaks it (tl;dr, the "this" context is incorrect when the object is converted to an IConnectionProfile)

@kburtram
Copy link
Member

kburtram commented Jun 1, 2023

Fix has been ported to hotfix branch.

@kburtram kburtram closed this as completed Jun 1, 2023
@Charles-Gagnon
Copy link
Contributor Author

Verified fixed in latest RC1

Version: 1.44.1-rc1 (user setup)
Commit: 8f53a31
Date: 2023-06-01T02:04:55.463Z
VS Code: 1.70.0
Electron: 19.1.8
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Windows_NT x64 10.0.22621

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants