-
Notifications
You must be signed in to change notification settings - Fork 66
Description
Describe the bug
When installing a package using PackageManager.InstallPackageAsync, only the start and end events of the upload phase (PackageInstallProgressState.Uploading) are reported through the IProgress callback.
It seems that the progress callback is not passed to the PushAsync method inside InstallPackageAsync, preventing granular upload progress updates.
Steps to reproduce the bug
var progress = new Progress<InstallProgressEventArgs>(e => Dummy(e));
await packageManager.InstallPackageAsync(
packageFilePath,
progress,
cancellationToken,
arguments: ["-r", "-t", "-g"]
);Observed:
Dummy(e) // e.State = Uploading, e.UploadProgress = 0
Dummy(e) // e.State = Uploading, e.UploadProgress = 100Expected behavior
During the upload phase (PackageInstallProgressState.Uploading),
the IProgress callback should be invoked continuously with incremental values of e.UploadProgress (e.g., 0.0 → 0.1 → 0.2 → … → 1.0) reflecting the actual upload progress of the package file.
This would allow consumers to display real-time progress bars or logs during package installation, consistent with the behavior of SyncService.PushAsync when a progress reporter is provided.
Screenshots
Root cause
The InstallPackageAsync method calls:
await sync.PushAsync(stream, remoteFilePath, UnixFileStatus.DefaultFileMode, File.GetLastWriteTime(localFilePath), null, cancellationToken);It does not pass the progress callback.
Proposed Fix
await sync.PushAsync(stream, remoteFilePath, UnixFileStatus.DefaultFileMode, File.GetLastWriteTime(localFilePath), progress, cancellationToken);NuGet package version
Latest Source
.NET Platform
.NET 9
Platform type
Windows
System version
No response
IDE
Rider 2025
Additional context
No response