dropbox-sdk-dotnet
dropbox-sdk-dotnet copied to clipboard
An attempt to add cancellation token to async methods (#41)
This is an attempt to add cancellation capability to async methods by adding the CancellationToken optional argument as follows:
- Changed csharp.py code generator to add the CancellationToken to Async methods.
- Changed DropboxRequestHandler to support cancellation while calling HttpClient methods and while performing the retry.
- Changed DropboxClient to support cancellation for RefreshAccessToken.
- Adding cancellation support to JsonWriter by using the async overloads of Newtonsoft.
- I didn't implement the cancellation for JsonReader since it's called after the request is completed.
Checklist
General Contributing
- [x] Have you read the Code of Conduct and signed the CLA?
Is This a Code Change?
- [ ] Non-code related change (markdown/git settings etc)
- [x] SDK Code Change
- [ ] Example/Test Code Change
Validation
- [x] Does this code build successfully?
- [ ] Do all tests pass?
- [x] Does Stylecop pass?
Codecov Report
Merging #209 (0c04841) into main (587b5e4) will decrease coverage by
0.00%. The diff coverage is17.85%.
@@ Coverage Diff @@
## main #209 +/- ##
==========================================
- Coverage 10.17% 10.17% -0.01%
==========================================
Files 17 17
Lines 1572 1573 +1
==========================================
Hits 160 160
- Misses 1412 1413 +1
| Flag | Coverage Δ | |
|---|---|---|
| unit | 10.17% <17.85%> (-0.01%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| dropbox-sdk-dotnet/Dropbox.Api/DropboxClient.cs | 0.00% <0.00%> (ø) |
|
| ...ox-sdk-dotnet/Dropbox.Api/DropboxRequestHandler.cs | 0.00% <0.00%> (ø) |
|
| dropbox-sdk-dotnet/Dropbox.Api/Stone/Encoder.cs | 14.43% <20.83%> (-0.16%) |
:arrow_down: |
| dropbox-sdk-dotnet/Dropbox.Api/Stone/JsonWriter.cs | 39.06% <29.41%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 587b5e4...a19eca8. Read the comment docs.
Hi @greg-db Would you please review this PR? I tried to be comprehensive in terms of explaining the details. Please do let me know if anything is unclear. Thanks!
Thanks for putting this together! I'm not the right person to do the actual review, but I'll ask the team to review this when they can.
Thanks, @greg-db! I'm not yet familiar with all Dropboxers! :) I think @connorworley or @rogebrd could help review this.
Hi @greg-db @connorworley Is there any update on this PR?
@AlirezaMaddah This is still open with the team, but I don't have an update on this right now.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 2 committers have signed the CLA.
:x: Alireza Maddah
:x: AlirezaMaddah
Alireza Maddah seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.