Sample code not working
See original GitHub issueHello,
I was trying tdsharp for the first time and seem to struggle in the early stages already. Actually I can not get the sample (TDLib.Samples.GetChats) to work even.
Everything seems to work fine for me about authorization and getting the list of chats in the line (got my apikey, hash, etc.) :
var chats = await _client.ExecuteAsync(new TdApi.GetChats { OffsetOrder = offsetOrder, Limit = limit, OffsetChatId = offsetId });
I get the result and see the list of ids, so up to here everything seems to be good. However once trying to get a chat via:
var chat = await _client.ExecuteAsync(new TdApi.GetChat { ChatId = chatId });
the code never returns and hangs indefinitely.
When I set _client.Bindings.SetLogVerbosityLevel(4) I can see that actually the chat-object is received in the console log (e.g. see the chat data like Title and the last message text), howver the code doesnt return on the await and the log then starts to show this and keeps repeating forever:
[ 3][t 0][1618689825.941023350][Client.cpp:276][&td_requests] End to wait for updates, returning object 4 00000213F9649BC0
[ 3][t 0][1618689825.947626352][Client.cpp:270][&td_requests] Begin to wait for updates with timeout 0.100000
[ 3][t 0][1618689826.055353165][Client.cpp:276][&td_requests] End to wait for updates, returning object 0 0000000000000000
[ 3][t 0][1618689826.055695534][Client.cpp:270][&td_requests] Begin to wait for updates with timeout 0.100000
[ 3][t 0][1618689826.167449713][Client.cpp:276][&td_requests] End to wait for updates, returning object 0 0000000000000000
[ 3][t 0][1618689826.167587996][Client.cpp:270][&td_requests] Begin to wait for updates with timeout 0.100000
[ 3][t 0][1618689826.275973558][Client.cpp:276][&td_requests] End to wait for updates, returning object 0 0000000000000000
[ 3][t 0][1618689826.276258945][Client.cpp:270][&td_requests] Begin to wait for updates with timeout 0.100000
[ 3][t 0][1618689826.386847734][Client.cpp:276][&td_requests] End to wait for updates, returning object 0 0000000000000000
I set my project to use .NET Core 3.0 and added via nuget: TDLib TDLib.Api tdlib.native
As it is an official sample I guess the code is fine and my project settings/references might be wrong… but as the connecting part and getting the chatlist result just fine, I can’t figure out what the problem might be.
(the code tested is 100% the sample code with just my authorization details added)
Thanks in advance!
Issue Analytics
- State:
- Created 2 years ago
- Comments:13
Top GitHub Comments
The most likely reason the sample project does not work for you is that you’ve installed tdlib.native 1.6 into that project. That means for now we have the following options:
https://github.com/egramtel/tdsharp/pull/100