wiz0u / WTelegramClient

Telegram Client API (MTProto) library written 100% in C# and .NET
https://wiz0u.github.io/WTelegramClient/
MIT License
996 stars 164 forks source link

exception: Cannot find type for ctor #568a748 #145

Closed m0nax3 closed 1 year ago

m0nax3 commented 1 year ago

Version: 3.4.2 When: simple LoginUserIfNeeded and listen updates

An exception occured in the reactor: WTelegram.WTException: Cannot find type for ctor #568a748
   at TL.Serialization.ReadTLObject(BinaryReader reader, UInt32 ctorNb)
   at TL.Serialization.ReadTLValue(BinaryReader reader, Type type)
   at TL.Serialization.ReadTLVector(BinaryReader reader, Type type)
   at TL.Serialization.ReadTLValue(BinaryReader reader, Type type)
   at TL.Serialization.ReadTLObject(BinaryReader reader, UInt32 ctorNb)
   at TL.Serialization.ReadTLValue(BinaryReader reader, Type type)
   at TL.Serialization.ReadTLVector(BinaryReader reader, Type type)
   at TL.Serialization.ReadTLValue(BinaryReader reader, Type type)
   at TL.Serialization.ReadTLObject(BinaryReader reader, UInt32 ctorNb)
   at TL.Serialization.ReadTLValue(BinaryReader reader, Type type)
   at TL.Serialization.ReadTLObject(BinaryReader reader, UInt32 ctorNb)
   at TL.Serialization.ReadTLValue(BinaryReader reader, Type type)
   at TL.Serialization.ReadTLObject(BinaryReader reader, UInt32 ctorNb)
   at TL.Serialization.ReadTLValue(BinaryReader reader, Type type)
   at TL.Serialization.ReadTLVector(BinaryReader reader, Type type)
   at TL.Serialization.ReadTLValue(BinaryReader reader, Type type)
   at TL.Serialization.ReadTLObject(BinaryReader reader, UInt32 ctorNb)
   at WTelegram.Client.ReadFrame(Byte[] data, Int32 dataLen)
   at WTelegram.Client.Reactor(Stream stream, CancellationTokenSource cts) 
ERROR While deserializing vector<%Message>: WTelegram.WTException: Cannot find type for ctor #568a748
   at TL.Serialization.ReadTLObject(BinaryReader reader, UInt32 ctorNb)
   at TL.Serialization.ReadTLValue(BinaryReader reader, Type type)
   at TL.Serialization.ReadTLVector(BinaryReader reader, Type type)
   at TL.Serialization.ReadTLValue(BinaryReader reader, Type type)
   at TL.Serialization.ReadTLObject(BinaryReader reader, UInt32 ctorNb)
   at TL.Serialization.ReadTLValue(BinaryReader reader, Type type)
   at TL.Serialization.ReadTLVector(BinaryReader reader, Type type)
   at TL.Serialization.ReadTLValue(BinaryReader reader, Type type)
   at TL.Serialization.ReadTLObject(BinaryReader reader, UInt32 ctorNb)
   at TL.Serialization.ReadTLValue(BinaryReader reader, Type type)
   at TL.Serialization.ReadTLObject(BinaryReader reader, UInt32 ctorNb)
   at TL.Serialization.ReadTLValue(BinaryReader reader, Type type)
   at TL.Serialization.ReadTLObject(BinaryReader reader, UInt32 ctorNb)
   at TL.Serialization.ReadTLValue(BinaryReader reader, Type type)
   at TL.Serialization.ReadTLVector(BinaryReader reader, Type type)
   at TL.Serialization.ReadTLValue(BinaryReader reader, Type type)
   at TL.Serialization.ReadTLObject(BinaryReader reader, UInt32 ctorNb)
   at WTelegram.Client.ReadMsgContainer(BinaryReader reader)
wiz0u commented 1 year ago

Such errors may happen initially (right after LoginUserIfNeeded) when you just updated your version of WTelegramClient. (this is because old updates based on previous version of the API layer have accumulated while your client was stopped)

In which case, some errors like this may show up in the logs but WTelegramClient should be able to ignore the errors and continue execution normally. After the initial batch of updates, that error should not show up again.

Keep me informed if you still see this error (for that user account), or if it no longer happens.

m0nax3 commented 1 year ago

should me remove .session file and relogin? i see this errors already few days...

wiz0u commented 1 year ago

can you provide some logs?

wiz0u commented 1 year ago

should me remove .session file and relogin?

i see no reason this would help but you may try (after saving some logs for me)

m0nax3 commented 1 year ago

WorkerService.Threads.RealtimeCmdThread.log

wiz0u commented 1 year ago

a temporary workaround could be to downgrade to WTC v3.3.3 or 3.3.2 (layer 156 or 155)

wiz0u commented 1 year ago

see also https://t.me/tdlibchat/71969

wiz0u commented 1 year ago

In any case, I will close this issue because I don't think it's an issue in the library, it's server-side so this problem should be tracked with Telegram teams.