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

feat(upload): add support for streamed uploads of Big File #1436

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

okhex
Copy link
Contributor

@okhex okhex commented Sep 9, 2024

Streamed uploads

  • A total_stream_size variable must be used to keep track of the total number of bytes read from the stream.

  • upload.saveBigFilePart must always be used, even if the stream turns out to be smaller than 10MB.

  • The file_total_parts field must be set to -1 for all parts except for the last one, using the following logic:

[Streamed uploads](https://core.telegram.org/api/files#streamed-uploads)
- A total_stream_size variable must be used to keep track of the total
number of bytes read from the stream.

- upload.saveBigFilePart must always be used, even if the stream turns
out to be smaller than 10MB.

- The file_total_parts field must be set to -1 for all parts except for
the last one, using the following logic:
@ernado ernado merged commit 7bcc83a into gotd:main Sep 16, 2024
13 checks passed
Copy link

codecov bot commented Sep 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.08%. Comparing base (ac6bc17) to head (67750c8).
Report is 31 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1436      +/-   ##
==========================================
+ Coverage   71.02%   71.08%   +0.05%     
==========================================
  Files         442      442              
  Lines       17744    17753       +9     
==========================================
+ Hits        12602    12619      +17     
+ Misses       4209     4202       -7     
+ Partials      933      932       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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