fix: stabilize memory sync progress
This commit is contained in:
@@ -84,12 +84,12 @@ describe("memory manager sync failures", () => {
|
||||
// Call the internal scheduler directly; it uses fire-and-forget sync.
|
||||
(manager as unknown as { scheduleWatchSync: () => void }).scheduleWatchSync();
|
||||
|
||||
await vi.runAllTimersAsync();
|
||||
await vi.runOnlyPendingTimersAsync();
|
||||
const syncPromise = syncSpy.mock.results[0]?.value as Promise<void> | undefined;
|
||||
vi.useRealTimers();
|
||||
if (syncPromise) {
|
||||
await syncPromise.catch(() => undefined);
|
||||
}
|
||||
await vi.runOnlyPendingTimersAsync();
|
||||
|
||||
process.off("unhandledRejection", handler);
|
||||
expect(unhandled).toHaveLength(0);
|
||||
|
||||
@@ -876,7 +876,9 @@ export class MemoryIndexManager {
|
||||
force?: boolean;
|
||||
progress?: (update: MemorySyncProgressUpdate) => void;
|
||||
}) {
|
||||
const progress = params?.progress ? this.createSyncProgress(params.progress) : null;
|
||||
const progress = params?.progress
|
||||
? this.createSyncProgress(params.progress)
|
||||
: undefined;
|
||||
const vectorReady = await this.ensureVectorReady();
|
||||
const meta = this.readMeta();
|
||||
const needsFullReindex =
|
||||
|
||||
Reference in New Issue
Block a user