Summary
A user-facing error toast — "Unable to get organizations due to error: Error: Authentication required" — appears when GitLens fetches organizations in the background while no active authentication session exists. This is an expected condition (user not signed in), not an actionable error, and should not surface to the user.
Impact
Any user without an active GitKraken session may see this unexpected error toast. The notification can also intercept pointer events in the editor until dismissed, causing secondary UX issues.
Root Cause
When the Home webview is open and the subscription state changes, SubscriptionService calls organizations.getOrganizations() to update the org count. If no authentication session is active, the request fails with AuthenticationRequiredError — an expected condition that is treated as a hard error and surfaced as a toast.
This is inconsistent with how the same error is handled elsewhere in the codebase (enrichmentService, draftsView, launchpadView), where AuthenticationRequiredError is caught and handled silently.
Additionally, the error message uses direct exception interpolation which, for certain AuthenticationError types, may expose token metadata (microHash, scopes, expiresAt) in the user-visible toast. The existing getPresentableErrorMessage helper should be used instead to safely format user-facing error strings.
Validation
- Open VS Code with GitLens
- Ensure no GitKraken account session is active
- Open the Home view
- Trigger any subscription state change
- Observe: "Unable to get organizations due to error: Error: Authentication required" toast appears (Source: GitLens — Git supercharged)
Expected: no toast for an unauthenticated background fetch; error logged at debug level only.
Risk
Low — affects only notification behavior for background fetches when unauthenticated. No functional change to organization loading or subscription state.
Gitlens Version
2026.4.220
Summary
A user-facing error toast — "Unable to get organizations due to error: Error: Authentication required" — appears when GitLens fetches organizations in the background while no active authentication session exists. This is an expected condition (user not signed in), not an actionable error, and should not surface to the user.
Impact
Any user without an active GitKraken session may see this unexpected error toast. The notification can also intercept pointer events in the editor until dismissed, causing secondary UX issues.
Root Cause
When the Home webview is open and the subscription state changes,
SubscriptionServicecallsorganizations.getOrganizations()to update the org count. If no authentication session is active, the request fails withAuthenticationRequiredError— an expected condition that is treated as a hard error and surfaced as a toast.This is inconsistent with how the same error is handled elsewhere in the codebase (
enrichmentService,draftsView,launchpadView), whereAuthenticationRequiredErroris caught and handled silently.Additionally, the error message uses direct exception interpolation which, for certain
AuthenticationErrortypes, may expose token metadata (microHash, scopes, expiresAt) in the user-visible toast. The existinggetPresentableErrorMessagehelper should be used instead to safely format user-facing error strings.Validation
Expected: no toast for an unauthenticated background fetch; error logged at debug level only.
Risk
Low — affects only notification behavior for background fetches when unauthenticated. No functional change to organization loading or subscription state.
Gitlens Version
2026.4.220