Skip to content

Conversation

@weiyuanyue
Copy link
Contributor

Fix #365

  • Add ct.ThrowIfCancellationRequested() check at the start of download loop
  • Ensures cancellation is checked on every iteration for immediate response
  • Add unit test to verify OperationCanceledException is thrown on cancellation
  • Resolves issue where downloads continued to 100% despite cancel requests

- Add ct.ThrowIfCancellationRequested() check at the start of download loop
- Ensures cancellation is checked on every iteration for immediate response
- Add unit test to verify OperationCanceledException is thrown on cancellation
- Resolves issue where downloads continued to 100% despite cancel requests
@vercel
Copy link

vercel bot commented Jan 7, 2026

Someone is attempting to deploy a commit to the MSFT-AIP Team on Vercel.

A member of the Team first needs to authorize it.

MillyWei added 2 commits January 7, 2026 18:37
- Add cancellation check after yielding progress for faster response
- Improve test to simulate realistic mid-download cancellation
- Add test for pre-cancelled token scenario
- Update assertions to account for async pipeline behavior

Fixes issue where downloads continue to 100% despite cancellation request
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.

CancellationToken Not Honored in IModel.DownloadAsync Method

1 participant