Skip to content

[fix] Enable adaptive downscale after client timeouts#291

Merged
paul-fresquet merged 2 commits into
masterfrom
fix/upload-adaptive-real-downscale
Apr 26, 2026
Merged

[fix] Enable adaptive downscale after client timeouts#291
paul-fresquet merged 2 commits into
masterfrom
fix/upload-adaptive-real-downscale

Conversation

@paul-fresquet
Copy link
Copy Markdown
Contributor

Summary

  • Downscale upload settings after consecutive client-side upload timeouts.
  • Reduce parallelism before chunk size, then allow chunk size to go below 500 KB down to the 64 KB floor.
  • Add unit coverage for timeout-driven downscale and minimum chunk size behavior.

Test plan

  • dotnet test tests/ByteSync.Client.UnitTests/ByteSync.Client.UnitTests.csproj --filter AdaptiveUploadControllerTests
  • dotnet test tests/ByteSync.Client.UnitTests/ByteSync.Client.UnitTests.csproj
  • dotnet test tests/ByteSync.Client.IntegrationTests/ByteSync.Client.IntegrationTests.csproj

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enables adaptive downscaling of upload settings in response to repeated client-side upload timeouts, so uploads can recover by reducing parallelism first and then shrinking chunk size down to a 64 KB floor.

Changes:

  • Track consecutive client timeouts and trigger a downscale after a fixed threshold.
  • Refactor downscale logic into a shared helper and reuse it for both bandwidth-based and timeout-based downscales.
  • Add/adjust unit tests to cover timeout-driven downscale behavior and minimum chunk size behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/ByteSync.Client/Services/Communications/Transfers/Uploading/AdaptiveUploadController.cs Adds consecutive-timeout tracking and reuses a unified Downscale(...) path for both timeout and slow-window triggers.
tests/ByteSync.Client.UnitTests/Services/Communications/Transfers/Uploading/AdaptiveUploadControllerTests.cs Adds unit coverage for timeout-driven downscale (parallelism-first and chunk-size floor).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sonarqubecloud
Copy link
Copy Markdown

@paul-fresquet paul-fresquet merged commit ee8fc4e into master Apr 26, 2026
24 checks passed
@paul-fresquet paul-fresquet deleted the fix/upload-adaptive-real-downscale branch April 26, 2026 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants