The WorkspaceApps component in site/src/pages/WorkspacesPage/WorkspacesTable.tsx#L642 calls useQuery(apiKey()) on mount, which fires a POST /api/v2/users/me/keys via API.getApiKey() to generate a new session key. This runs every time the workspaces page loads, even though the key is only needed when a user actually clicks a VS Code desktop link. The key should be generated lazily on click (similar to how VSCodeDesktopButton.tsx already does it) instead of eagerly on page load.
Created on behalf of @deansheather
The
WorkspaceAppscomponent insite/src/pages/WorkspacesPage/WorkspacesTable.tsx#L642callsuseQuery(apiKey())on mount, which fires aPOST /api/v2/users/me/keysviaAPI.getApiKey()to generate a new session key. This runs every time the workspaces page loads, even though the key is only needed when a user actually clicks a VS Code desktop link. The key should be generated lazily on click (similar to howVSCodeDesktopButton.tsxalready does it) instead of eagerly on page load.Created on behalf of @deansheather