Skip to content

Improve management of web sessions when connection changes#1808

Open
isc-bsaviano wants to merge 2 commits into
intersystems-community:masterfrom
isc-bsaviano:fix-1805
Open

Improve management of web sessions when connection changes#1808
isc-bsaviano wants to merge 2 commits into
intersystems-community:masterfrom
isc-bsaviano:fix-1805

Conversation

@isc-bsaviano

Copy link
Copy Markdown
Contributor

This PR fixes #1805. I will implement a companion for Language Server as well.

Comment thread src/extension.ts Outdated
// For new ones, establish a connection?
// For orphans, logout and clear the cookies.
let refreshFilesExplorer = false;
const newConnections: Set<string> = new Set();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const newConnections = new Set<string>(); is equivalent and more concise.

Comment thread src/extension.ts
Comment on lines -1524 to -1535
if (affectsConfiguration("objectscript.conn") || affectsConfiguration("intersystems.servers")) {
if (affectsConfiguration("intersystems.servers")) {
// Gather the server names previously resolved
const resolvedServers: string[] = [];
resolvedConnSpecs.forEach((v, k) => resolvedServers.push(k));
// Clear the cache
resolvedConnSpecs.clear();
// Resolve them again, sequentially in case user needs to be prompted for credentials
for await (const serverName of resolvedServers) {
await resolveConnectionSpec(serverName);
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First, thank you for this fix! It indeed fixes the problem I reported in #1805.

--

But I noticed one new problem: changes to a server in intersystems.servers no longer take effect until I reload the window.

Reproducable by:

  1. Connect normally. Set "objectscript.outputRESTTraffic": true to see the requests in the "ObjectScript" output.
  2. In intersystems.servers, change the webServer.port of that server to a wrong/closed port and save.
  3. The connection stays connected, and the output still shows requests going to the old port.
  4. Run "Developer: Reload Window". Only now the new port is used, and the connection fails (because the port is wrong).

On 3.8.2 the same change takes effect immediately, without a reload.

--

It looks like the old code re-read the server settings when intersystems.servers changed, and that part was removed in this PR. So the extension seems to keep using the old (cached) connection details until a reload. Maybe the fix needs to re-read / refresh the server spec for the changed servers again.

@isc-bsaviano
isc-bsaviano requested a review from isc-klu July 17, 2026 15:51
@isc-bsaviano

Copy link
Copy Markdown
Contributor Author

Thank you for the feedback @tobikrs. I believe I have addressed your issue. Please try this VSIX:
vscode-objectscript-3.8.3-dev.1808.vsix.zip

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.

Multi-root workspace: activating each namespace reconnects all active connections and orphans CSP sessions, exhausting the license

3 participants