diff --git a/src/RemoteContainers.Aspire/Docker/DockerApiClient.cs b/src/RemoteContainers.Aspire/Docker/DockerApiClient.cs index 7852ab5..71c9566 100644 --- a/src/RemoteContainers.Aspire/Docker/DockerApiClient.cs +++ b/src/RemoteContainers.Aspire/Docker/DockerApiClient.cs @@ -107,8 +107,10 @@ public DockerApiClient(ILogger logger, HttpClient httpClient, A _logger.LogError(ex, "Docker API request failed for {ResourceName}; retrying…", resourceName); } - lastSeenId = null; - isFirstPoll = false; + // Do not reset lastSeenId or isFirstPoll — a transient error gives no information about the + // container state, so the existing stabilization state must be preserved. Resetting would + // set lastSeenId to null, causing the next successful find to be accepted immediately via the + // "appeared after an empty poll" path, which defeats the two-poll confirmation. } await Task.Delay(pollInterval, cancellationToken);