Files
ChatLab/packages/node-runtime
CEQ151andClaude Opus 4.8 185e88ba3e fix(import): refresh sidebar message count after incremental import
After incremental import via Electron IPC, the sidebar session list
showed stale message counts. Three contributing gaps:

1. The chat:incrementalImport IPC handler did not notify the renderer
   to refresh the session list (unlike the API route which calls
   notifySessionListChanged). Added win.webContents.send('api:importCompleted')
   to trigger the Sidebar's existing onImportCompleted listener.

2. The postImportHook in worker adapters was async (due to dynamic
   import()) but the caller did not await it, causing a race condition
   where loadSessions() could read stale overview cache before
   computeAndSetOverviewCache() finished. Converted to static import
   making the hook synchronous, and updated the type to void | Promise<void>
   with await at call sites in both incremental-importer and
   streaming-importer.

3. The @imported handlers on group-chat and private-chat pages only
   refreshed local analysis data without calling sessionStore.loadSessions().
   Added the call so the sidebar updates immediately on the client side.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 10:20:28 +08:00
..