Files
ChatLab/apps/desktop
diguaandClaude Opus 4.8 7316a09823 fix(ai): fix stale overview and analysis caches after incremental import
Overview cache had no self-invalidation: once written it would return
stale lastMessageTs forever if the postImportHook failed silently.
Analysis query cache (17 chart/stats queries) was never cleared on
import, so charts showed stale data until the user triggered a manual
invalidate.

Add MAX(message.id) fingerprint to OverviewCache and introduce
getValidatedOverviewCache(), which recomputes automatically when new
messages are inserted. Update resolveOverview() in the Electron worker
to use this instead of bare getCache().

In both postImportHooks (incrementalImport, streamImport) also call
deleteSessionCache against the query cache directory so chart data is
fresh after every import.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 11:36:46 +08:00
..