Skip to content

Conversation

@lixmal
Copy link
Collaborator

@lixmal lixmal commented Oct 28, 2025

Describe your changes

  • When the OIDC flow is in progress, enable the Disconnect button for cancellation. Otherwise both buttons are disabled and there is no way to cancel the flow.
  • On OIDC timeout, consult daemon status to enable correct buttons instead of relying on defer
  • Clean up error handling

Issue ticket number and link

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

Docs PR URL (required if "docs added" is checked)

Paste the PR link from https://github.com/netbirdio/docs here:

https://github.com/netbirdio/docs/pull/__

Copilot AI review requested due to automatic review settings October 28, 2025 14:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a race condition where the Connect and Disconnect buttons could be enabled or disabled simultaneously during OIDC authentication flows. The changes ensure proper button state management by tracking ongoing connect operations and consulting daemon status after operations complete.

Key Changes:

  • Added context cancellation support for connect operations to allow interruption during OIDC flow
  • Modified Connect/Disconnect button handlers to properly manage state through status updates instead of immediate re-enabling
  • Improved error handling with structured error wrapping and gRPC status code checking

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
client/ui/client_ui.go Updated login and connection methods to accept context for cancellation; improved error handling with error wrapping
client/ui/event_handler.go Added connect operation cancellation support and status-based button updates; enhanced error handling for cancelled operations
client/ui/profile.go Updated callback signature to accept context parameter

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sonarqubecloud
Copy link

@lixmal lixmal merged commit d3a34ad into main Oct 28, 2025
35 of 36 checks passed
@lixmal lixmal deleted the ui-buttons-fix branch October 28, 2025 20:21
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.

3 participants