Closed jurij-jukic closed 5 months ago
Thanks for your feedback!
I assume that you have already set the LOCAL_TDLIB_PATH
variable since you managed to get it started once and you are using the default
feature.
So I ask you to try doing the following things from the project root and keeping the single thread tokio runtime:
cargo clean
rm -rf ./get_me_db
cargo run -p tdlib-rs --example get_me --features default
I will wait for your reply!
P.S. If you are interested in using this library we are developing a Tui for Telegram, I will leave you the link.
Thanks for the quick reply!
Same issue is happening after I run these commands.
Btw, then I also need to reallow libtdjson.1.8.19.dylib, since Apple complains about it as an unknown app. I need to go to System Settings to allow it to run. Might be worth documenting as it's not obvious that it needs to be manually allowed to run.
Re the TUI, yup, I was looking at it and got it to run!
Your feedback will be very helpful for us.
We tested this library locally in the following OS:
Anyway, are you on macos arm? Do you want to do a PR to add this documentation or do I do it?
It's strange that the tui works and this lib doesn't, do you have any ideas?
Yeah, I'm on MacOS arm.
Not sure where to put it, so here is the info and you can add it: Error which pops up when trying to run it: '“libtdjson.1.8.19.dylib” can’t be opened because Apple cannot check it for malicious software.' Go to System Settings -> Privacy and Security -> '“libtdjson.1.8.19.dylib” was blocked from use...' -> Allow Anyway. And then rerun and it should work.
To give you some more info... once I comment out the verbosity command, the terminal output looks like so (infinite loop):
[ 3][t 0][1717159238.230424165][Client.cpp:280][&td_requests] Begin to wait for updates with timeout 2.000000
[ 3][t 0][1717159240.231490135][Client.cpp:293][&td_requests] End to wait for updates, returning object 0 0x0
[ 3][t 0][1717159240.231584072][Client.cpp:280][&td_requests] Begin to wait for updates with timeout 2.000000
[ 3][t 0][1717159242.232661008][Client.cpp:293][&td_requests] End to wait for updates, returning object 0 0x0
...
I am not familiar with Telegram api, but you might know what's happening here.
Fantastic! Thank you, I'll add this recommendation.
So, is the TUI working properly? I'm asking you these things in order to understand the problem.
have you set these variables?
export API_HASH="a3406de8d171bb422bb6ddf3bbd800e2"
export API_ID="94575"
Can you send us the output with 3 of verbosity?
Another thing, try to go on your telegram application and click terminate all other sessions
in Settings
-> Devices
and then run:
cargo clean
rm -rf ./get_me_db
cargo run -p tdlib-rs --example get_me --features default
After closing the session and rerunning everything, the user flow gets stuck after entering verification code. Then I will have an incomplete login attempt show up in Telegram -> Settings -> Devices. Under the incomplete login attempt it says: "The devices above have no access to your messages. The code was entered correctly, but no correct password was given.".
I re-did the TUI flow (after cargo clean
ing that repo) and that flow did ask me for the password.
So I think this identifies it - the get_me.rs
flow doesn't ask for the password, and therefore gets stuck at an incomplete login attempt.
Thank you. I modified the code by adding this part as you suggested. Wait to hear from you in order to resolve this issue đź‘Ť
Tested it, works correctly!
Using this command:
cargo run -p tdlib-rs --example get_me --features default
I get the following output:and then it gets stuck here and I don't get to the interactive part.
It worked once previously (got me half way through the flow, and then got stuck as well), and since I wasn't able to run it.
Worth noting that I am running it with a single threaded tokio runtime
#[tokio::main(flavor = "current_thread")]
, rather than multi-threaded as originally in the project. When running it multi-threaded, it gets stuck similarly.