fewensa / telegram-client

Rust Telegram Client
MIT License
93 stars 13 forks source link

Serialization issues with tdlib v1.7.0 #25

Closed seguidor777 closed 3 years ago

seguidor777 commented 3 years ago

Hello,

I'm trying this telegram client crate and when I run my program it shows many errors related to the json serialization. The versions that I'm using are Rust 1.52.1, tdlib v1.7.0 (I checked out this tag) and I have these crates in my Cargo.toml: telegram-client = "1.7.0" rtdlib = "1.7.*"

These are the errors and they're shown on every start up:

2021-08-08 23:45:15,147 ERROR [telegram_client::handler] TELEGRAM DATA FAIL. IF YOU SEE THIS MESSAGE, PLEASE POST AN ISSUE TO https://github.com/fewensa/telegram-client/issues 
 INCLUDE THIS JSON => {"@type":"updateOption","name":"unix_time","value":{"@type":"optionValueInteger","value":"1628487914"}}
2021-08-08 23:45:15,147 ERROR [telegram_client::handler] SerdeJson(Error("unknown field `\"{} can\'t deserialize to {}::{}\", updateOption, TdType, UpdateOption, _e`, expected `\"{:?}\", _e`", line: 0, column: 0))
2021-08-08 23:45:15,150 ERROR [telegram_client::handler] TELEGRAM DATA FAIL. IF YOU SEE THIS MESSAGE, PLEASE POST AN ISSUE TO https://github.com/fewensa/telegram-client/issues 
 INCLUDE THIS JSON => {"@type":"updateOption","name":"call_packet_timeout_ms","value":{"@type":"optionValueInteger","value":"10000"}}
2021-08-08 23:45:15,150 ERROR [telegram_client::handler] SerdeJson(Error("unknown field `\"{} can\'t deserialize to {}::{}\", updateOption, TdType, UpdateOption, _e`, expected `\"{:?}\", _e`", line: 0, column: 0))
2021-08-08 23:45:15,150 ERROR [telegram_client::handler] TELEGRAM DATA FAIL. IF YOU SEE THIS MESSAGE, PLEASE POST AN ISSUE TO https://github.com/fewensa/telegram-client/issues 
 INCLUDE THIS JSON => {"@type":"updateOption","name":"call_connect_timeout_ms","value":{"@type":"optionValueInteger","value":"30000"}}
2021-08-08 23:45:15,150 ERROR [telegram_client::handler] SerdeJson(Error("unknown field `\"{} can\'t deserialize to {}::{}\", updateOption, TdType, UpdateOption, _e`, expected `\"{:?}\", _e`", line: 0, column: 0))
2021-08-08 23:45:15,151 ERROR [telegram_client::handler] TELEGRAM DATA FAIL. IF YOU SEE THIS MESSAGE, PLEASE POST AN ISSUE TO https://github.com/fewensa/telegram-client/issues 
 INCLUDE THIS JSON => {"@type":"updateOption","name":"basic_group_size_max","value":{"@type":"optionValueInteger","value":"200"}}
2021-08-08 23:45:15,151 ERROR [telegram_client::handler] SerdeJson(Error("unknown field `\"{} can\'t deserialize to {}::{}\", updateOption, TdType, UpdateOption, _e`, expected `\"{:?}\", _e`", line: 0, column: 0))
2021-08-08 23:45:15,152 ERROR [telegram_client::handler] TELEGRAM DATA FAIL. IF YOU SEE THIS MESSAGE, PLEASE POST AN ISSUE TO https://github.com/fewensa/telegram-client/issues 
 INCLUDE THIS JSON => {"@type":"updateOption","name":"telegram_service_notifications_chat_id","value":{"@type":"optionValueInteger","value":"777000"}}
2021-08-08 23:45:15,152 ERROR [telegram_client::handler] SerdeJson(Error("unknown field `\"{} can\'t deserialize to {}::{}\", updateOption, TdType, UpdateOption, _e`, expected `\"{:?}\", _e`", line: 0, column: 0))
2021-08-08 23:45:15,153 ERROR [telegram_client::handler] TELEGRAM DATA FAIL. IF YOU SEE THIS MESSAGE, PLEASE POST AN ISSUE TO https://github.com/fewensa/telegram-client/issues 
 INCLUDE THIS JSON => {"@type":"updateOption","name":"forwarded_message_count_max","value":{"@type":"optionValueInteger","value":"100"}}
2021-08-08 23:45:15,153 ERROR [telegram_client::handler] SerdeJson(Error("unknown field `\"{} can\'t deserialize to {}::{}\", updateOption, TdType, UpdateOption, _e`, expected `\"{:?}\", _e`", line: 0, column: 0))
2021-08-08 23:45:15,153 ERROR [telegram_client::handler] TELEGRAM DATA FAIL. IF YOU SEE THIS MESSAGE, PLEASE POST AN ISSUE TO https://github.com/fewensa/telegram-client/issues 
 INCLUDE THIS JSON => {"@type":"updateOption","name":"supergroup_size_max","value":{"@type":"optionValueInteger","value":"200000"}}
2021-08-08 23:45:15,153 ERROR [telegram_client::handler] SerdeJson(Error("unknown field `\"{} can\'t deserialize to {}::{}\", updateOption, TdType, UpdateOption, _e`, expected `\"{:?}\", _e`", line: 0, column: 0))
2021-08-08 23:45:15,154 ERROR [telegram_client::handler] TELEGRAM DATA FAIL. IF YOU SEE THIS MESSAGE, PLEASE POST AN ISSUE TO https://github.com/fewensa/telegram-client/issues 
 INCLUDE THIS JSON => {"@type":"updateOption","name":"group_anonymous_bot_user_id","value":{"@type":"optionValueInteger","value":"1087968824"}}
2021-08-08 23:45:15,154 ERROR [telegram_client::handler] SerdeJson(Error("unknown field `\"{} can\'t deserialize to {}::{}\", updateOption, TdType, UpdateOption, _e`, expected `\"{:?}\", _e`", line: 0, column: 0))
2021-08-08 23:45:15,154 ERROR [telegram_client::handler] TELEGRAM DATA FAIL. IF YOU SEE THIS MESSAGE, PLEASE POST AN ISSUE TO https://github.com/fewensa/telegram-client/issues 
 INCLUDE THIS JSON => {"@type":"updateOption","name":"pinned_chat_count_max","value":{"@type":"optionValueInteger","value":"5"}}
2021-08-08 23:45:15,154 ERROR [telegram_client::handler] SerdeJson(Error("unknown field `\"{} can\'t deserialize to {}::{}\", updateOption, TdType, UpdateOption, _e`, expected `\"{:?}\", _e`", line: 0, column: 0))
2021-08-08 23:45:15,155 ERROR [telegram_client::handler] TELEGRAM DATA FAIL. IF YOU SEE THIS MESSAGE, PLEASE POST AN ISSUE TO https://github.com/fewensa/telegram-client/issues 
 INCLUDE THIS JSON => {"@type":"updateOption","name":"message_text_length_max","value":{"@type":"optionValueInteger","value":"4096"}}
2021-08-08 23:45:15,155 ERROR [telegram_client::handler] SerdeJson(Error("unknown field `\"{} can\'t deserialize to {}::{}\", updateOption, TdType, UpdateOption, _e`, expected `\"{:?}\", _e`", line: 0, column: 0))
2021-08-08 23:45:15,155 ERROR [telegram_client::handler] TELEGRAM DATA FAIL. IF YOU SEE THIS MESSAGE, PLEASE POST AN ISSUE TO https://github.com/fewensa/telegram-client/issues 
 INCLUDE THIS JSON => {"@type":"updateOption","name":"message_caption_length_max","value":{"@type":"optionValueInteger","value":"1024"}}
2021-08-08 23:45:15,155 ERROR [telegram_client::handler] SerdeJson(Error("unknown field `\"{} can\'t deserialize to {}::{}\", updateOption, TdType, UpdateOption, _e`, expected `\"{:?}\", _e`", line: 0, column: 0))
2021-08-08 23:45:15,156 ERROR [telegram_client::handler] TELEGRAM DATA FAIL. IF YOU SEE THIS MESSAGE, PLEASE POST AN ISSUE TO https://github.com/fewensa/telegram-client/issues 
 INCLUDE THIS JSON => {"@type":"updateOption","name":"favorite_stickers_limit","value":{"@type":"optionValueInteger","value":"5"}}
2021-08-08 23:45:15,156 ERROR [telegram_client::handler] SerdeJson(Error("unknown field `\"{} can\'t deserialize to {}::{}\", updateOption, TdType, UpdateOption, _e`, expected `\"{:?}\", _e`", line: 0, column: 0))
2021-08-08 23:45:15,156 ERROR [telegram_client::handler] TELEGRAM DATA FAIL. IF YOU SEE THIS MESSAGE, PLEASE POST AN ISSUE TO https://github.com/fewensa/telegram-client/issues 
 INCLUDE THIS JSON => {"@type":"updateOption","name":"pinned_archived_chat_count_max","value":{"@type":"optionValueInteger","value":"100"}}
2021-08-08 23:45:15,156 ERROR [telegram_client::handler] SerdeJson(Error("unknown field `\"{} can\'t deserialize to {}::{}\", updateOption, TdType, UpdateOption, _e`, expected `\"{:?}\", _e`", line: 0, column: 0))
2021-08-08 23:45:15,157 ERROR [telegram_client::handler] TELEGRAM DATA FAIL. IF YOU SEE THIS MESSAGE, PLEASE POST AN ISSUE TO https://github.com/fewensa/telegram-client/issues 
 INCLUDE THIS JSON => {"@type":"updateOption","name":"replies_bot_chat_id","value":{"@type":"optionValueInteger","value":"1271266957"}}
2021-08-08 23:45:15,157 ERROR [telegram_client::handler] SerdeJson(Error("unknown field `\"{} can\'t deserialize to {}::{}\", updateOption, TdType, UpdateOption, _e`, expected `\"{:?}\", _e`", line: 0, column: 0))

I'm posting the errors as suggested in the logs. Please let me know if I need to use specific version in order to silence these message. I think this is some sort of incompatibility between versions.

fewensa commented 3 years ago

The reply is late, I think the problem should be caused by the mismatch between the current version of crate and tdlib. The more information you can read this issue https://github.com/tdlib/td/issues/1419

I will be adapting to the new version recently, and I look forward to solving these problems

This is caused by another question, the data type is number, but returned data is string

fewensa commented 3 years ago

related: https://github.com/fewensa/telegram-client/issues/22 https://github.com/fewensa/telegram-client/issues/16 https://github.com/fewensa/telegram-client/issues/20 https://github.com/fewensa/fantasy/issues/1

fewensa commented 3 years ago

will fix the next version

seguidor777 commented 3 years ago

Great, thanks!

fewensa commented 3 years ago

The new version released https://crates.io/crates/telegram-client

fewensa commented 3 years ago

There are some api changes, you need upgrade your project. follow examples. Now the telegram-client support use async api in event handler.

fewensa commented 3 years ago

In addition, it is recommended that you modify your dependencies as

telegram-client = "=1.7.1"
rtdlib = "=1.7.1"

More informations: https://github.com/fewensa/telegram-client#version

seguidor777 commented 3 years ago

Awesome, will do, and come back to you if I find something. Thanks for your support