Skip to content

Conversation

@RAMTO
Copy link
Contributor

@RAMTO RAMTO commented Dec 22, 2025

Description:
Handles disconnect functionality supporting multiple organizations

Related issue(s):

Fixes #2134 and #2135

Notes for reviewer:
@jbair06 We could not test the following scenarios:

  • Multiple orgs compatibility issue
  • Login after update (If I build the app with a lower version in package.json an update is triggered and download is initiated, although due to a missing artefacts/releases the update is not finished)

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@RAMTO RAMTO requested a review from jbair06 December 22, 2025 14:13
@RAMTO RAMTO changed the base branch from main to 2105-use-electron-updater-with-version-check-url-and-handle-update-errors December 22, 2025 14:13
@codecov
Copy link

codecov bot commented Dec 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.85%. Comparing base (1dc573e) to head (9b34260).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2137   +/-   ##
=======================================
  Coverage   99.85%   99.85%           
=======================================
  Files         175      175           
  Lines        6831     6832    +1     
  Branches     1315     1303   -12     
=======================================
+ Hits         6821     6822    +1     
  Misses         10       10           
Files with missing lines Coverage Δ
...-end/apps/api/src/guards/frontend-version.guard.ts 100.00% <100.00%> (ø)

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Base automatically changed from 2105-use-electron-updater-with-version-check-url-and-handle-update-errors to main December 22, 2025 16:02
@RAMTO RAMTO force-pushed the 2134-handle-mandatory-update-refusal-by-disconnecting-from-organization-only-not-quitting-app branch 2 times, most recently from 899bd2f to bcaf254 Compare December 23, 2025 07:07
@Noobushi
Copy link
Contributor

Changes regarding the last commit:

  • introduced healthCheck handling for 426 error (version check) and allows login into personal mode
  • removed dublication of toatser notifications
  • adds new notification for user clarity when trying to change into outdated organization via the dropdown menu
  • fixed the slider showing "off" by default by syncing websocket connection events with the organizationConnection store, so each organization’s connection status is tracked correctly
  • websocked disconnect handler preservers status messages instead of overwritting them with generic error

@Noobushi Noobushi marked this pull request as ready for review December 29, 2025 14:51
@Noobushi Noobushi requested review from a team and yiliev0 as code owners December 29, 2025 14:51
@Noobushi Noobushi marked this pull request as draft December 30, 2025 15:57
RAMTO and others added 17 commits January 3, 2026 12:27
Signed-off-by: Martin Dobrev <[email protected]>
Signed-off-by: Martin Dobrev <[email protected]>
Signed-off-by: Martin Dobrev <[email protected]>
Signed-off-by: Martin Dobrev <[email protected]>
Signed-off-by: Martin Dobrev <[email protected]>
Signed-off-by: Valentin Sirakov <[email protected]>
Signed-off-by: Valentin Sirakov <[email protected]>
@RAMTO RAMTO force-pushed the 2134-handle-mandatory-update-refusal-by-disconnecting-from-organization-only-not-quitting-app branch from bfc1547 to 02294ce Compare January 3, 2026 10:27
@Noobushi Noobushi force-pushed the 2134-handle-mandatory-update-refusal-by-disconnecting-from-organization-only-not-quitting-app branch from 02294ce to d88a60e Compare January 5, 2026 13:11
Signed-off-by: Valentin Sirakov <[email protected]>
@RAMTO RAMTO force-pushed the 2134-handle-mandatory-update-refusal-by-disconnecting-from-organization-only-not-quitting-app branch from d88a60e to 324053c Compare January 5, 2026 13:13
@RAMTO RAMTO force-pushed the 2134-handle-mandatory-update-refusal-by-disconnecting-from-organization-only-not-quitting-app branch 3 times, most recently from 062a3f4 to 08f1866 Compare January 6, 2026 07:36
@RAMTO RAMTO marked this pull request as ready for review January 6, 2026 07:36
Signed-off-by: Martin Dobrev <[email protected]>

chore: refactor and code clean up

Signed-off-by: Martin Dobrev <[email protected]>

chore: more refactoring

Signed-off-by: Martin Dobrev <[email protected]>

chore: code cleanup

Signed-off-by: Martin Dobrev <[email protected]>

chore: code clean up

Signed-off-by: Martin Dobrev <[email protected]>

chore: code clean up

Signed-off-by: Martin Dobrev <[email protected]>

chore: code clean up

Signed-off-by: Martin Dobrev <[email protected]>

chore: code clean up

Signed-off-by: Martin Dobrev <[email protected]>

chore: code clean up

Signed-off-by: Martin Dobrev <[email protected]>

chore: unused code removed

Signed-off-by: Martin Dobrev <[email protected]>

chore: code clean up and reformattinf

Signed-off-by: Martin Dobrev <[email protected]>

chore: unused function removed

Signed-off-by: Martin Dobrev <[email protected]>

chore: unused code removed

Signed-off-by: Martin Dobrev <[email protected]>
@RAMTO RAMTO force-pushed the 2134-handle-mandatory-update-refusal-by-disconnecting-from-organization-only-not-quitting-app branch from 08f1866 to 7c313f4 Compare January 6, 2026 08:08
@jbair06 jbair06 requested a review from Copilot January 7, 2026 07:44
Copy link

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 implements a multi-organization version management system that allows users to disconnect from organizations requiring updates instead of being forced to quit the entire application. The implementation adds organization-specific connection status tracking, version compatibility checking across organizations, and a comprehensive UI for managing organization connections.

Key Changes:

  • Introduced per-organization version state management and connection status tracking
  • Implemented semver-based version compatibility checking to detect conflicts when updating for one organization may break compatibility with others
  • Replaced app quit functionality with organization disconnect functionality in mandatory upgrade flows

Reviewed changes

Copilot reviewed 25 out of 26 changed files in this pull request and generated 16 comments.

Show a summary per file
File Description
front-end/src/renderer/utils/toastOptions.ts Added warning and info toast options for new notification types
front-end/src/renderer/utils/index.ts Added formatProgressBytes utility function and fixed spacing in stringifyHbarWithFont
front-end/src/renderer/utils/axios.ts Enhanced 426 error interceptor to extract server URL, store per-organization version data, and trigger compatibility checks
front-end/src/renderer/types/userStore.ts Added ConnectionStatus and DisconnectReason types plus connection metadata to ConnectedOrganization
front-end/src/renderer/stores/versionState.ts Implemented organization-specific version tracking with refs for status, URLs, versions, and compatibility results
front-end/src/renderer/stores/storeWebsocketConnection.ts Added connection state tracking per organization and skip connection logic for disconnected orgs
front-end/src/renderer/stores/storeUser.ts Added logic to prevent selecting disconnected organizations requiring upgrades
front-end/src/renderer/stores/storeOrganizationConnection.ts New store managing connection status and disconnect reasons per organization
front-end/src/renderer/services/organization/versionCompatibility.ts New service implementing semver-based compatibility checking across organizations
front-end/src/renderer/services/organization/reconnect.ts New service handling organization reconnection with version checks
front-end/src/renderer/services/organization/health.ts Modified to treat 426 responses as healthy servers
front-end/src/renderer/services/organization/disconnect.ts New service handling organization disconnection with various reasons
front-end/src/renderer/services/organization/index.ts Added exports for disconnect and reconnect services
front-end/src/renderer/pages/Settings/components/OrganizationsTab.vue Enhanced to display connection status, version info, and compatibility warnings with toggle controls
front-end/src/renderer/composables/useVersionCheck.ts Extended to store and retrieve organization-specific version data
front-end/src/renderer/components/Organization/ConnectionToggle.vue New component providing UI toggle for connecting/disconnecting organizations
front-end/src/renderer/components/Organization/ConnectionStatusBadge.vue New component displaying organization connection status with icons and tooltips
front-end/src/renderer/components/Organization/CompatibilityWarningModal.vue New modal warning users about version compatibility conflicts
front-end/src/renderer/components/Organization/AddOrganizationModal.vue Enhanced to check version compatibility when adding new organizations
front-end/src/renderer/components/GlobalAppProcesses/components/OptionalUpgrade.vue Updated to check compatibility and show warnings for optional updates
front-end/src/renderer/components/GlobalAppProcesses/components/MandatoryUpgrade.vue Replaced quit with disconnect functionality and added compatibility warnings
front-end/src/renderer/components/GlobalAppProcesses/GlobalAppProcesses.vue Added organization version checks on app launch with compatibility checking
front-end/pnpm-lock.yaml Updated semver dependency to 7.7.1
front-end/package.json Added semver 7.7.1 and @types/semver 7.5.8 dependencies
back-end/apps/api/src/guards/frontend-version.guard.ts Updated 426 response to include latestSupportedVersion and renamed minimumVersion field
back-end/apps/api/src/guards/frontend-version.guard.spec.ts Updated test to use new minimumSupportedVersion field name
Files not reviewed (1)
  • front-end/pnpm-lock.yaml: Language not supported

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

RAMTO added 3 commits January 7, 2026 10:34
Signed-off-by: Martin Dobrev <[email protected]>
Signed-off-by: Martin Dobrev <[email protected]>
Signed-off-by: Martin Dobrev <[email protected]>
@jbair06 jbair06 self-requested a review January 8, 2026 00:51
Copy link
Member

@jbair06 jbair06 left a comment

Choose a reason for hiding this comment

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

We will need to come up with a good testing strategy. That said, let's merge this and get it up on our dev network for some better testing.

@jbair06 jbair06 merged commit ca76b41 into main Jan 8, 2026
20 checks passed
@jbair06 jbair06 deleted the 2134-handle-mandatory-update-refusal-by-disconnecting-from-organization-only-not-quitting-app branch January 8, 2026 09:03
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.

Handle mandatory update refusal by disconnecting from organization only (not quitting app)

4 participants