Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
impl: improve logging during connection setup
  • Loading branch information
fioan89 committed Aug 26, 2025
commit 836a74b61425e7febd9371922ba80e7f7cc500ab
4 changes: 4 additions & 0 deletions src/main/kotlin/com/coder/toolbox/CoderRemoteProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -398,11 +398,15 @@ class CoderRemoteProvider(
context.secrets.lastDeploymentURL = client.url.toString()
context.secrets.lastToken = client.token ?: ""
context.secrets.storeTokenFor(client.url, context.secrets.lastToken)
context.logger.info("Deployment URL and token were stored and will be available for automatic connection")
this.client = client
pollJob?.cancel()
context.logger.info("Previous poll job was canceled")
environments.showLoadingMessage()
coderHeaderPage.setTitle(context.i18n.pnotr(client.url.toString()))
context.logger.info("Displaying ${client.url} in the UI")
pollJob = poll(client, cli)
context.logger.info("Workspace poller job created with reference $pollJob")
context.envPageManager.showPluginEnvironmentsPage()
}

Expand Down
3 changes: 3 additions & 0 deletions src/main/kotlin/com/coder/toolbox/views/ConnectStep.kt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class ConnectStep(
signInJob?.cancel()
signInJob = context.cs.launch(CoroutineName("Http and CLI Setup")) {
try {
context.logger.info("Setting up the HTTP client...")
val client = CoderRestClient(
context,
CoderCliSetupContext.url!!,
Expand Down Expand Up @@ -104,6 +105,7 @@ class ConnectStep(
yield()
CoderCliSetupContext.reset()
CoderCliSetupWizardState.goToFirstStep()
context.logger.info("Connection setup done, initializing the workspace poller...")
onConnect(client, cli)
} catch (ex: CancellationException) {
if (ex.message != USER_HIT_THE_BACK_BUTTON) {
Expand All @@ -130,6 +132,7 @@ class ConnectStep(

override fun onBack() {
try {
context.logger.info("Back button was pressed, cancelling in-progress connection setup...")
signInJob?.cancel(CancellationException(USER_HIT_THE_BACK_BUTTON))
} finally {
if (shouldAutoLogin.value) {
Expand Down