Skip to content

[ENG-11736] pass downloaded bytes, IP and completed flag to callback#494

Open
ihorsokhanexoft wants to merge 2 commits into
CenterForOpenScience:developfrom
ihorsokhanexoft:feature/ENG-11736
Open

[ENG-11736] pass downloaded bytes, IP and completed flag to callback#494
ihorsokhanexoft wants to merge 2 commits into
CenterForOpenScience:developfrom
ihorsokhanexoft:feature/ENG-11736

Conversation

@ihorsokhanexoft

Copy link
Copy Markdown

https://openscience.atlassian.net/browse/ENG-11736

In the payload the following properties appear now:
image

download_file, download_zip actions are marked as completed only if we get 200 or 302 from a provider

@sh-andriy sh-andriy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good overall thanks.
Just one thing that i noticed:
Saw your note - completed on 200/302 from the provider catches provider-side failures, but not the client cancelling mid-download. WB's already sent 200 once it starts streaming, and write_stream swallows the disconnect, so a user who aborts a big zip still lands as completed=True with only partial bytes. The client specifically wants to tell finished vs aborted apart, so we'd need the StreamClosedError signal out of write_stream, not just the response status.

@sh-andriy sh-andriy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

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