feat: implement pending file event handling using durable queue with acknowledgment support in folder synchronization

This commit is contained in:
Anish Sarkar 2026-04-03 00:40:49 +05:30
parent b46c5532b3
commit e0b35cfbab
6 changed files with 175 additions and 35 deletions

View file

@ -6,6 +6,8 @@ import {
removeWatchedFolder,
getWatchedFolders,
getWatcherStatus,
getPendingFileEvents,
acknowledgeFileEvents,
pauseWatcher,
resumeWatcher,
markRendererReady,
@ -52,6 +54,14 @@ export function registerIpcHandlers(): void {
markRendererReady();
});
ipcMain.handle(IPC_CHANNELS.FOLDER_SYNC_GET_PENDING_EVENTS, () =>
getPendingFileEvents()
);
ipcMain.handle(IPC_CHANNELS.FOLDER_SYNC_ACK_EVENTS, (_event, eventIds: string[]) =>
acknowledgeFileEvents(eventIds)
);
ipcMain.handle(IPC_CHANNELS.BROWSE_FILE_OR_FOLDER, () => browseFileOrFolder());
ipcMain.handle(IPC_CHANNELS.READ_LOCAL_FILES, (_event, paths: string[]) =>