You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
fix: don't create new api keys each time we do workspace polling (#568)
* fix: don't create new api keys each time we do workspace pollingThe default behavior for `coder login --token <token>` is to:- use the provided token temporarily to authenticate the login process- generate a new session token and stores that for future CLI use- the original token provided is not stored or reusedThe Coder `Recent projects` view polls every 5 seconds for workspaces frommultiple Coder deployment. The polling process also involves a callto the `cli.login`. The cli is later used start workspaces if user clicks ona project for which the workspace is stopped. Instead of generating a new tokeneach time we login we can use the `coder login --use-token-as-session --token <token>` which:- uses the provided token directly as the session token- stores the original token for future CLI commands- no new token is generated* refactor: only login the cli when starting workspacesThe Coder `Recent projects` view polls every 5 seconds for workspaces frommultiple Coder deployment. The polling process also involves a callto the `cli.login`. The cli is later used to start workspaces if a user clicks ona project for which the workspace is stopped. The login can be called on demand, onlywhen a "recent" project is stopped and the user wants to start it. This commitreduces a lot of overhead associated with spawning cli commands every 5 seconds.* chore: next version is 2.22.2
val inLoadingState=listOf(WorkspaceStatus.STARTING,WorkspaceStatus.CANCELING,WorkspaceStatus.DELETING,WorkspaceStatus.STOPPING).contains(workspaceWithAgent.workspace.latestBuild.status)
@@ -216,7 +222,13 @@ class CoderGatewayRecentWorkspaceConnectionsView(private val setContentCallback:
216
222
label("").resizableColumn().align(AlignX.FILL)
217
223
}.topGap(gap)
218
224
219
-
val enableLinks=listOf(WorkspaceStatus.STOPPED,WorkspaceStatus.CANCELED,WorkspaceStatus.FAILED,WorkspaceStatus.STARTING,WorkspaceStatus.RUNNING).contains(workspaceWithAgent?.workspace?.latestBuild?.status)