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

TdApi.DownloadFile receives no update when offset>256KB #3170

Closed
cdxf opened this issue Dec 5, 2024 · 5 comments
Closed

TdApi.DownloadFile receives no update when offset>256KB #3170

cdxf opened this issue Dec 5, 2024 · 5 comments

Comments

@cdxf
Copy link

cdxf commented Dec 5, 2024

I’m trying to download a large file (>100MB) using TdApi.DownloadFile.
When the offset < 262144 bytes, the download completes successfully and quickly.
However, when the offset >= 262144 bytes, the download gets stuck.
I no longer receive any updates, and the temporary directory creates a 512KB file with no further progress.
tdlib.log

@cdxf
Copy link
Author

cdxf commented Dec 5, 2024

In the previous log, I have deleted the temp file then redownload.
But even if I start with a clean state, It still get stuck
Log here:
tdlib.log

@levlam
Copy link
Contributor

levlam commented Dec 9, 2024

I pushed fixes for the issue, but as getRemoteFile documentation states, your approach isn't guaranteed to work anyway "with a clean state":

Even the request succeeds, the file can be used only if it is still accessible to the user. For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application

@cdxf
Copy link
Author

cdxf commented Dec 9, 2024

When I tried to rebuild TD, I encountered the following build error (even though the build continued). I will report whether the fix works later.

PartsManager.cpp
D:\project\td\td\telegram\files\PartsManager.cpp(436,29): error C2672: 'td::min': no matching overloaded function found
[D:\project\td\build\tdcore.vcxproj]
ResourceManager.cpp
D:\project\td\tdutils\td\utils\common.h(109,3):
could be 'T td::min(T,T)'
D:\project\td\td\telegram\files\PartsManager.cpp(436,29):
'T td::min(T,T)': template parameter 'T' is ambiguous
D:\project\td\td\telegram\files\PartsManager.cpp(436,29):
could be 'td::int64'
D:\project\td\td\telegram\files\PartsManager.cpp(436,29):
or 'size_t'
D:\project\td\td\telegram\files\PartsManager.cpp(436,29):
'T td::min(T,T)': could not deduce template argument for 'T' from 'const td::int64'

D:\project\td\td\telegram\files\PartsManager.cpp(440,31): error C2672: 'td::min': no matching overloaded function found
[D:\project\td\build\tdcore.vcxproj]
D:\project\td\tdutils\td\utils\common.h(109,3):
could be 'T td::min(T,T)'
D:\project\td\td\telegram\files\PartsManager.cpp(440,31):
'T td::min(T,T)': template parameter 'T' is ambiguous
D:\project\td\td\telegram\files\PartsManager.cpp(440,31):
could be 'td::int64'
D:\project\td\td\telegram\files\PartsManager.cpp(440,31):
or 'size_t'
D:\project\td\td\telegram\files\PartsManager.cpp(440,31):
'T td::min(T,T)': could not deduce template argument for 'T' from 'const td::int64'

D:\project\td\td\telegram\files\PartsManager.cpp(444,26): error C2672: 'td::min': no matching overloaded function found
[D:\project\td\build\tdcore.vcxproj]
D:\project\td\tdutils\td\utils\common.h(109,3):
could be 'T td::min(T,T)'
D:\project\td\td\telegram\files\PartsManager.cpp(444,26):
'T td::min(T,T)': template parameter 'T' is ambiguous
D:\project\td\td\telegram\files\PartsManager.cpp(444,26):
could be 'td::int64'
D:\project\td\td\telegram\files\PartsManager.cpp(444,26):
or 'size_t'
D:\project\td\td\telegram\files\PartsManager.cpp(444,26):
'T td::min(T,T)': could not deduce template argument for 'T' from 'const td::int64'

@cdxf
Copy link
Author

cdxf commented Dec 9, 2024

I rebuild the Java example project, get error when run this cmd:

cmake -A x64 -DCMAKE_INSTALL_PREFIX:PATH=../../../tdlib -DCMAKE_TOOLCHAIN_FILE:FILEPATH=../../../vcpkg/scripts/buildsystems/vcpkg.cmake -DTd_DIR:PATH=$(Resolve-Path ../td/lib/cmake/Td) ..
cmake --build . --target install --config Release

D:\project\td\example\java\td_jni.cpp(201,16): error C2039: 'get_static_field_id': is not a member of 'td::jni' [D:\pro
ject\td\example\java\build\tdjni.vcxproj]
D:\project\td\example\java\td\include\td\tl\tl_jni_object.h(23,11):
see declaration of 'td::jni'

D:\project\td\example\java\td_jni.cpp(201,16): error C3861: 'get_static_field_id': identifier not found [D:\project\td
example\java\build\tdjni.vcxproj]
D:\project\td\example\java\td_jni.cpp(202,41): error C2039: 'fetch_static_string': is not a member of 'td::jni' [D:\pro
ject\td\example\java\build\tdjni.vcxproj]
D:\project\td\example\java\td\include\td\tl\tl_jni_object.h(23,11):
see declaration of 'td::jni'

D:\project\td\example\java\td_jni.cpp(202,41): error C3861: 'fetch_static_string': identifier not found [D:\project\td
example\java\build\tdjni.vcxproj]
D:\project\td\example\java\td_jni.cpp(203,43): error C2039: 'get_git_commit_hash': is not a member of 'td::td_api' [D:
project\td\example\java\build\tdjni.vcxproj]

@levlam
Copy link
Contributor

levlam commented Dec 9, 2024

Thank you. I have just pushed a fix for the compilation error.

@cdxf cdxf closed this as completed Dec 10, 2024
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

No branches or pull requests

2 participants