perf(activity): save activity history incrementally through an activity store and sync queue
The renderer no longer sends the whole history on every change. Domain actions on an external activity store update the list and queue the matching contract changes; activity-sync.ts flushes them every 250 ms via activityHistory.update (<= 20,000 per call), keeps failed changes queued in order with backoff retry, and flushes on quit and unmount. replace remains only for the legacy localStorage migration; clearing uses the new activityHistory.clear IPC. App's activity state is gone; ActivityPanel reads a selector. update is now required in the desktop API.
This commit is contained in:
@@ -1293,6 +1293,9 @@ const desktopApi: DesktopApi = {
|
||||
},
|
||||
update: async (update: ActivityHistoryUpdate) => {
|
||||
await ipcRenderer.invoke(ipcChannels.activityHistoryUpdate, update)
|
||||
},
|
||||
clear: async () => {
|
||||
await ipcRenderer.invoke(ipcChannels.activityHistoryClear)
|
||||
}
|
||||
},
|
||||
usage: {
|
||||
|
||||
Reference in New Issue
Block a user