Cut over the window to Explorer.Host.exe so only the host writes the index.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-24 17:39:13 +02:00
parent 7c23bc2474
commit 48d03f794f
26 changed files with 774 additions and 59 deletions

View File

@@ -11,9 +11,13 @@ public class WorkbenchHostTests
{
var indexing = new FakeIndexing();
var transfers = new FakeTransfers();
IWorkbenchHost host = new WorkbenchHost(indexing, transfers);
var sources = new StubSources();
var mutations = new StubMutations();
IWorkbenchHost host = new WorkbenchHost(indexing, transfers, sources, mutations);
Assert.Same(indexing, host.Indexing);
Assert.Same(transfers, host.Transfers);
Assert.Same(sources, host.Sources);
Assert.Same(mutations, host.Mutations);
host.Indexing.EnqueueFullScan(7);
host.Transfers.PauseAll();
@@ -57,4 +61,30 @@ public class WorkbenchHostTests
public bool MoveUp(long jobId) => false;
public bool MoveDown(long jobId) => false;
}
private sealed class StubSources : ISourceHost
{
public Task RefreshAsync(CancellationToken cancellationToken = default) => Task.CompletedTask;
public Task<Source> AddUncAsync(string path, CancellationToken cancellationToken = default)
=> Task.FromResult(new Source { StableKey = "x", DisplayName = path });
public Task<Source?> EnsureForPathAsync(string path, CancellationToken cancellationToken = default)
=> Task.FromResult<Source?>(null);
public Task<bool> ForgetAsync(string path, CancellationToken cancellationToken = default)
=> Task.FromResult(false);
}
private sealed class StubMutations : IIndexMutations
{
public Task<long> UpsertSyncProfileAsync(SyncProfile profile, CancellationToken cancellationToken = default)
=> Task.FromResult(0L);
public Task DeleteSyncProfileAsync(long id, CancellationToken cancellationToken = default) => Task.CompletedTask;
public Task<long> UpsertOperationProfileAsync(OperationProfile profile, CancellationToken cancellationToken = default)
=> Task.FromResult(0L);
public Task DeleteOperationProfileAsync(long id, CancellationToken cancellationToken = default) => Task.CompletedTask;
public Task<long> CreateRenameBatchAsync(IReadOnlyList<RenameBatchItem> items, CancellationToken cancellationToken = default)
=> Task.FromResult(0L);
public Task MarkRenameBatchUndoneAsync(long id, CancellationToken cancellationToken = default) => Task.CompletedTask;
public Task EnqueueHashCollisionsAsync(long? sourceId, CancellationToken cancellationToken = default) => Task.CompletedTask;
public Task UpsertRelationAsync(FileRelation relation, CancellationToken cancellationToken = default) => Task.CompletedTask;
}
}