Skip to content

Conversation

@RonenMars
Copy link
Contributor

@RonenMars RonenMars commented Dec 28, 2025

Description

  • Remove Zustand persist middleware from stores that should not cache data across sessions
  • Delete unused useDashboardStore (dead code)
  • Clean up StoreName enum by removing unused entries

Motivation

Several stores were persisting data that should be fetched fresh from the backend, leading to potential stale data issues:

  • Organization/User data: Should be fetched fresh on authentication
  • Project lists: Can change between sessions
  • Build files: Build info changes with deployments
  • Integrations cache: Should be fetched from backend
  • Org connections: Should be fetched from backend

Changes

Stores - Persist Removed (5)

Store Reason
useCacheStore Integrations should be fetched fresh
useOrgConnectionsStore Org connections fetched from backend
useOrganizationStore User/org data fetched on auth
useProjectStore Project lists fetched fresh
useBuildFilesStore Build info can change between sessions

Deleted - Dead Code (1)

Store Reason
useDashboardStore Never used - not imported anywhere

Stores - Persist Kept (8)

Store Reason
useLoggerStore Debug log history across sessions
useFileStore Remember open files per project
useManualRunStore Remember run configuration
useTemplatesStore Template cache
useTourStore Track completed tours
useSharedBetweenProjectsStore UI preferences (panel widths, etc.)
useTablePreferencesStore Table column/sort preferences
useEventsDrawerStore Drawer entity and section state

Cleanup

  • Removed StoreName enum entries: project, organization, user, cache, drawer, dashboard, buildFiles
  • Deleted src/store/useDashboardStore.ts
  • Deleted src/interfaces/store/dashboardStore.interface.ts

What type of PR is this? (check all applicable)

  • 💡 (feat) - A new feature (non-breaking change which adds functionality)
  • 🔄 (refactor) - Code Refactoring - A code change that neither fixes a bug nor adds a feature
  • 🐞 (fix) - Bug Fix (non-breaking change which fixes an issue)
  • 🏎 (perf) - Optimization
  • 📄 (docs) - Documentation - Documentation only changes
  • 📄 (test) - Tests - Adding missing tests or correcting existing tests
  • ⚙️ (ci) - Continuous Integrations - Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
  • ☑️ (chore) - Chores - Other changes that don't modify src or test files
  • ↩️ (revert) - Reverts - Reverts a previous commit(s).

@RonenMars RonenMars force-pushed the ronen/refactor/remove-persistency-from-irrelevant-zustands-stores branch from c8e98ee to a1f207c Compare December 28, 2025 18:07
@RonenMars RonenMars requested a review from itayd December 28, 2025 18:19
@RonenMars RonenMars force-pushed the ronen/refactor/remove-persistency-from-irrelevant-zustands-stores branch 2 times, most recently from 2500963 to 27e8994 Compare December 29, 2025 16:45
@RonenMars RonenMars enabled auto-merge (squash) December 29, 2025 16:45
@RonenMars RonenMars force-pushed the ronen/refactor/remove-persistency-from-irrelevant-zustands-stores branch from d6bdf1d to fb5a187 Compare December 30, 2025 22:03
  Remove persist middleware from stores that should fetch fresh data or
  contain transient state. This prevents stale data issues and improves
  app reliability.

  Stores no longer persisted:
  - useCacheStore (integrations cache)
  - useOrgConnectionsStore (org connections)
  - useOrganizationStore (user/org data - fetch fresh on auth)
  - useProjectStore (project lists - fetch fresh)
  - useBuildFilesStore (build info can change)

  Removed unused code:
  - useDashboardStore (dead code - never imported)
  - dashboardStore.interface.ts
  - Unused StoreName enum entries

  Stores keeping persistence (legitimate UX/preferences):
  - useLoggerStore (debug log history)
  - useFileStore (open files per project)
  - useManualRunStore (run configuration)
  - useTemplatesStore (template cache)
  - useTourStore (completed tours)
  - useSharedBetweenProjectsStore (UI preferences)
  - useTablePreferencesStore (table settings)
  - useEventsDrawerStore (drawer entity/section state)
Remove 9 unused properties and their setters that were defined but never used anywhere in the codebase:

- isChatbotFullScreen / setIsChatbotFullScreen
- fullScreenEditor / setFullScreenEditor
- expandedProjectNavigation
- projectSplitScreenWidth / setProjectSplitScreenWidth
- lastVisitedUrl / setLastVisitedUrl
…tegrationSchema` and update its auth type to `ApiToken`
@RonenMars RonenMars force-pushed the ronen/refactor/remove-persistency-from-irrelevant-zustands-stores branch from 465cb18 to 4b00840 Compare December 30, 2025 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants