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

Don't attempt to open the SMP in a Simple Browser for IRIS 2024.1+ #223

Merged

Conversation

isc-bsaviano
Copy link
Contributor

@isc-bsaviano isc-bsaviano commented May 29, 2024

This PR fixes #224

@gjsjohnmurray
Copy link
Collaborator

Doing that seems unfair on pre 2024.1 sites that have already got this working.

@isc-bsaviano
Copy link
Contributor Author

I understand that some people might find this useful but I don't think that opening in an external browser is that much worse of a user experience. It's a shame that we didn't have advance notice of this change. I think that adding an IRIS version context key just to hide the button is too much work. I guess I can add another check to the Simple Browser-specific path but I don't like keeping features that only work on old versions. This is a modern/cutting edge tool; it seems wrong to me for it to have features that you have to be out of date to use.

@gjsjohnmurray
Copy link
Collaborator

I agree that retrofitting version info into the contextValue of the TreeItems is more work than can be justified here, though there may be future cases where what we show on a tree node needs to take account of the server version.

However I'm unhappy with backward-incompatible changes, and resist us releasing a new version of Server Manager in which a feature that was being used successfully on pre-2024.1 servers suddenly vanishes in the interests of not confusing 2024.1+ users by offering something that a back-incompatible server-side change has rendered non-operational.

Please enhance this code to do the version check and advise the 2024.1+ user that the button they pressed is unable to work with their server level.

if (target === BrowserTarget.SIMPLE && !simpleBrowserCompatible.has(name)) {
// Check that the portal webapps have all been altered so they don't require session cookie support, which Simple Browser cannot provide
const response = await makeRESTRequest(
"POST",
spec,
{ apiVersion: 1, namespace: "%SYS", path: "/action/query" },
{ query: "SELECT Name FROM Security.Applications WHERE {fn CONCAT(Name, '/')} %STARTSWITH '/csp/sys/' AND UseCookies = 2" },
);
if (response) {
const appsRequiringCookie = (response.data?.result?.content as any[]).map((row) => {
return row.Name as string;
});
if (appsRequiringCookie.length > 0) {
await vscode.window.showWarningMessage(`Portal web apps cannot be used in the Simple Browser tab if their 'UseCookies' property is set to 'Always' (the default). To resolve this, use Portal's security section to change it to 'Autodetect' in these apps: ${appsRequiringCookie.join(", ")}`, { modal: true });
return;
}
else {
simpleBrowserCompatible.set(name, true);
}
}
else {
vscode.window.showWarningMessage(`Unable to check the Portal web apps for compatibility with Simple Browser.`);
simpleBrowserCompatible.set(name, true);
}
}

@isc-bsaviano
Copy link
Contributor Author

I'll make that change for now but when IRIS versions 2024.1+ get more prevalent we will have to remove this button.

@isc-bsaviano isc-bsaviano changed the title Remove SMP Simple Browser button Don't attempt to open the SMP in a Simple Browser for IRIS 2024.1+ May 29, 2024
@isc-bsaviano isc-bsaviano merged commit 123c23d into intersystems-community:master May 29, 2024
5 checks passed
@isc-bsaviano isc-bsaviano deleted the remove-simple-browser branch May 29, 2024 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

White page - VS Simple browser
2 participants