Skip to content

feat: use the deployment's hostname suffix in the UI #133

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

Merged
merged 10 commits into from
Apr 15, 2025

Conversation

ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Apr 10, 2025

Closes #93.

image

The only time the hostname suffix is used by the desktop app is when an offline workspace needs to be shown in the list, where we naively append .coder. This PR sets this appended value to whatever --workspace-hostname-suffix is configured to deployment-side.

We read the config value from the deployment when:

  • The app is launched, if the user is signed in.
  • The user signs in.
  • The VPN is started.

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ethanndickson ethanndickson marked this pull request as ready for review April 10, 2025 06:46
headers: useLiteralHeaders ? literalHeaders.map { $0.toSDKHeader() } : []
)
Task {
await handleTokenExpiry()
Copy link
Member Author

@ethanndickson ethanndickson Apr 11, 2025

Choose a reason for hiding this comment

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

drive-by fix: we need to check for token expiry on app launch. We were previously only checking when the menu bar window was opened, and Connect was disabled. We need to account for when Connect is configured to start when the app is launched.

Comment on lines 164 to 167
// If fetching the config fails, there's likely a bigger issue.
// We'll show an error in the UI if they try and do something
logger.error("failed to refresh deployment config: \(error)")
return
Copy link
Member Author

@ethanndickson ethanndickson Apr 11, 2025

Choose a reason for hiding this comment

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

If we wanted to show that something went wrong to the user here, the UX would be awkward. I don't think we should create an alert or anything, and I don't think we should reuse the Connect failure error box.

I'm not sure how the user would get into a state where everything else was functional, except the deployment config couldn't be fetched, so I'm happy with this.

@ethanndickson ethanndickson self-assigned this Apr 11, 2025
Copy link
Member Author

ethanndickson commented Apr 15, 2025

Merge activity

  • Apr 14, 9:14 PM EDT: A user started a stack merge that includes this pull request via Graphite.
  • Apr 14, 9:14 PM EDT: A user merged this pull request with Graphite.

@ethanndickson ethanndickson merged commit afd9634 into main Apr 15, 2025
4 checks passed
@ethanndickson ethanndickson deleted the ethan/deployment-hostname-suffix branch April 15, 2025 01:36
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.

Incorporate dynamic workspace suffix into UI
2 participants