Skip to content

fix: o(n) requests on project switch + perisstance#801

Merged
k11kirky merged 1 commit intomainfrom
02-04-fix_o_n_requests_on_project_switch_perisstance
Feb 5, 2026
Merged

fix: o(n) requests on project switch + perisstance#801
k11kirky merged 1 commit intomainfrom
02-04-fix_o_n_requests_on_project_switch_perisstance

Conversation

@k11kirky
Copy link
Contributor

@k11kirky k11kirky commented Feb 5, 2026

TL;DR

Improved project selection logic and optimized query cache clearing when switching projects.

closes #798

What changed?

  • Enhanced project selection logic to maintain the current project when switching accounts if it's available in the new account's scoped teams
  • Added setStep to the dependency arrays in useActionSelectorState to ensure proper reactivity
  • Modified query cache clearing behavior when switching projects to only remove project-specific queries while preserving project list and user data
  • Added proper handling of available project IDs when authenticating

How to test?

  1. Log in with an account that has access to multiple projects
  2. Switch between projects and verify that the current project is maintained if available in both accounts
  3. Verify that the project switcher still shows the correct list of available projects after switching
  4. Check that navigation to task input works correctly after project selection

Why make this change?

This change improves the user experience when switching between projects by:

  1. Maintaining context when possible (keeping the same project if available)
  2. Preserving necessary data in the query cache to avoid unnecessary refetching
  3. Ensuring the project switcher has the correct data available immediately

Copy link
Contributor Author

k11kirky commented Feb 5, 2026

@k11kirky k11kirky marked this pull request as ready for review February 5, 2026 00:38
@k11kirky k11kirky requested a review from a team as a code owner February 5, 2026 00:38
Copy link
Contributor Author

k11kirky commented Feb 5, 2026

Merge activity

  • Feb 5, 2:16 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Feb 5, 2:19 AM UTC: Graphite rebased this pull request as part of a merge.
  • Feb 5, 2:21 AM UTC: @k11kirky merged this pull request with Graphite.

@k11kirky k11kirky changed the base branch from 02-04-feat_fix_multistep_questions to graphite-base/801 February 5, 2026 02:17
@k11kirky k11kirky changed the base branch from graphite-base/801 to main February 5, 2026 02:17
@k11kirky k11kirky force-pushed the 02-04-fix_o_n_requests_on_project_switch_perisstance branch from 3feae49 to 1657ea2 Compare February 5, 2026 02:18
@k11kirky k11kirky merged commit e2cb0e5 into main Feb 5, 2026
13 checks passed
@k11kirky k11kirky deleted the 02-04-fix_o_n_requests_on_project_switch_perisstance branch February 5, 2026 02: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.

Project switcher fires O(n) requests on every switch

2 participants