github thedotmack/claude-mem v5.2.1

latest releases: v10.0.7, v10.0.6, v10.0.5...
3 months ago

v5.2.1 (2025-11-07)

Breaking Changes: None (patch version)

Bug Fixes

This patch release fixes critical race conditions and state synchronization issues in the viewer UI's project filtering system.

Fixed Issues:

  • Race condition with offset reset: When filter changed, offset wasn't reset synchronously, causing incorrect pagination ranges (e.g., loading items 20-40 for new project with < 20 items)
  • State ref synchronization: stateRef.current.hasMore retained old value when filter changed, preventing new filter from loading if previous filter had no more data
  • Data mixing between projects: Batched state updates caused data from different projects to appear together in the UI
  • useEffect dependency cycle: handleLoadMore in dependencies caused double renders when filter changed
  • NULL projects in dropdown: Empty/NULL project values appeared in the project filter dropdown

Technical Improvements:

  • Combined two separate useEffect hooks into one for guaranteed execution order (reset → load)
  • Removed redundant filter change detection logic (DRY principle)
  • Simplified validation in mergeAndDeduplicateByProject function
  • Added investigated field to Summary interface for better session tracking

Files Changed:

  • src/ui/viewer/App.tsx - Fixed filter change detection and data reset logic
  • src/ui/viewer/hooks/usePagination.ts - Improved offset and state ref handling
  • src/ui/viewer/utils/data.ts - Simplified validation logic
  • src/services/sqlite/SessionStore.ts - Filter NULL/empty projects from dropdown
  • src/ui/viewer/types.ts - Added investigated field to Summary interface
  • src/ui/viewer/components/SummaryCard.tsx - Display investigated field

All changes follow CLAUDE.md coding standards: DRY, YAGNI, and fail-fast error handling.

Testing

Verified fixes work correctly:

  1. ✅ Select project from dropdown → Data loads immediately
  2. ✅ Switch between multiple projects → Only selected project's data shown (no mixing)
  3. ✅ Rapid switching between projects → No race conditions or stale data
  4. ✅ Switch back to "All Projects" → All data appears correctly with SSE updates

🤖 Generated with Claude Code

Don't miss a new claude-mem release

NewReleases is sending notifications on new releases.