Skip to content

Comments

fix: cross-entity React Query auto-invalidation for DB mode#15

Open
AkaraChen wants to merge 4 commits intomasterfrom
fix/refresh
Open

fix: cross-entity React Query auto-invalidation for DB mode#15
AkaraChen wants to merge 4 commits intomasterfrom
fix/refresh

Conversation

@AkaraChen
Copy link
Collaborator

Summary

  • All action hooks (useGameManagementActions, useSettingsActions, useProfileActions, useModManagementActions) now use a unified invalidate helper that is a no-op in Zustand mode and fires queryClient.invalidateQueries in DB mode
  • Game mutations (addManagedGame, removeManagedGame) now cascade-invalidate dependent queries: profiles, modManagement, and settings
  • Profile mutations (ensureDefaultProfile, createProfile, deleteProfile, resetGameProfilesToDefault, removeGameProfiles) now also invalidate the modManagement cache

Test plan

Fixes #13, fixes #14

🤖 Generated with Claude Code

AkaraChen and others added 4 commits February 10, 2026 14:12
Game/profile mutations now invalidate dependent query keys (profiles,
modManagement, settings) so related data refreshes automatically.
Unifies all action hooks to use a shared `invalidate` helper.

Fixes #13, fixes #14

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…alog race condition

- Remove async/await from better-sqlite3 transaction callbacks
- Add .run() for mutations and .all() for queries in transactions
- Wait for React Query cache refresh before closing add-game dialog
- Add error handling to prevent dialog close on failure

Fixes issue where better-sqlite3 v11.10+ throws "Transaction function
cannot return a promise" error. Also fixes race condition where dialog
would reopen immediately after adding a game due to stale cache.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.

Packages often did not able to refresh Game profile selection did not update in real time

1 participant