Skip to content

fix(dashboard): skip the sidebar org fetch when signed out - #445

Open
Rish-it wants to merge 1 commit into
oblien:mainfrom
Rish-it:fix/sidebar-org-fetch-signed-out
Open

fix(dashboard): skip the sidebar org fetch when signed out#445
Rish-it wants to merge 1 commit into
oblien:mainfrom
Rish-it:fix/sidebar-org-fetch-signed-out

Conversation

@Rish-it

@Rish-it Rish-it commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Guards the sidebar's org-list fetch effect so it doesn't fire when the user is signed out.

Motivation

The effect is keyed on the user id, which sign-out transitions to undefined. Without a guard, every logout fires two unauthenticated org calls that 401 and get swallowed by the catch, leaving only console noise.

Related issue

None

Changes

  • apps/dashboard: bail out of the sidebar org-fetch effect when user?.id is missing

Verification

Manual: signed out and confirmed no 401s fire from the sidebar org fetch on logout.

Checklist

  • One change per PR
  • The diff is scoped
  • A test fails without this change and passes with it (manual repro only, no existing test harness for this effect)
  • bun run test / lint / format (not run in this environment)
  • I understand every line of this diff and can explain it in review

Copilot AI lite review requested due to automatic review settings August 5, 2026 04:53

Copilot AI left a comment

Copy link
Copy Markdown

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 updates the dashboard sidebar’s org-switcher useEffect to avoid issuing unauthenticated organization requests when the user transitions to a signed-out state.

Changes:

  • Add a guard in the sidebar org-fetch effect to bail out when user?.id is missing.
  • Document why the guard is needed (prevents post-logout unauthenticated org calls and resulting console noise).

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

// user id, which sign-out transitions to undefined — without the guard every
// logout fires two unauthenticated org calls whose failures are swallowed by
// the catch, leaving only console noise.
if (!user?.id) return;
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.

2 participants