Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An attempt to add cancellation token to async methods (#41) #209

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

AlirezaMaddah
Copy link
Contributor

@AlirezaMaddah AlirezaMaddah commented Jan 21, 2021

This is an attempt to add cancellation capability to async methods by adding the CancellationToken optional argument as follows:

  1. Changed csharp.py code generator to add the CancellationToken to Async methods.
  2. Changed DropboxRequestHandler to support cancellation while calling HttpClient methods and while performing the retry.
  3. Changed DropboxClient to support cancellation for RefreshAccessToken.
  4. Adding cancellation support to JsonWriter by using the async overloads of Newtonsoft.
  5. I didn't implement the cancellation for JsonReader since it's called after the request is completed.

Checklist

General Contributing

  • Have you read the Code of Conduct and signed the CLA?

Is This a Code Change?

  • Non-code related change (markdown/git settings etc)
  • SDK Code Change
  • Example/Test Code Change

Validation

  • Does this code build successfully?
  • Do all tests pass?
  • Does Stylecop pass?

@codecov
Copy link

codecov bot commented Jan 21, 2021

Codecov Report

Merging #209 (0c04841) into main (587b5e4) will decrease coverage by 0.00%.
The diff coverage is 17.85%.

Impacted file tree graph

@@            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%) ⬇️

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%) ⬇️
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 data
Powered by Codecov. Last update 587b5e4...a19eca8. Read the comment docs.

@AlirezaMaddah
Copy link
Contributor Author

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!

@greg-db
Copy link
Contributor

greg-db commented Jan 21, 2021

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.

@AlirezaMaddah
Copy link
Contributor Author

Thanks, @greg-db!
I'm not yet familiar with all Dropboxers! :) I think @connorworley or @rogebrd could help review this.

@AlirezaMaddah
Copy link
Contributor Author

Hi @greg-db @connorworley
Is there any update on this PR?

@greg-db
Copy link
Contributor

greg-db commented Feb 9, 2021

@AlirezaMaddah This is still open with the team, but I don't have an update on this right now.

@CLAassistant
Copy link

CLAassistant commented Apr 16, 2022

CLA assistant check
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.

❌ Alireza Maddah
❌ 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.

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.

3 participants