wiz0u / WTelegramClient

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

BadMsgNotification 32 for msg #39C6 #222

Closed kitoytimmy123 closed 8 months ago

kitoytimmy123 commented 9 months ago

When my app has run about 1 day, it has high opportunity to occur the error "BadMsgNotification 32 for msg #39C6". And the result is the current session can not use, I have to login again to create a new session. How to fix this problem. Basic information: 1 I use MTProto 2 I send a message to a group per 30 seconds as heart beat. 3 no more other actions, just received OnUpdate event , and print to console.

kitoytimmy123 commented 9 months ago

I 'v modified function Helper.RandomLong();

and used DateTime.Now.Ticks as a initial data, and return increment data.

and it can run by the old session.

I'll wait and see if the problem occur again.

kitoytimmy123 commented 9 months ago

It happen again. BadMsgNotification 32 for msg #15C3

wiz0u commented 8 months ago

If you're the only one getting this, i bet you must be doing something weird with your session/session file/client, like copy/duplicate/instanciate them and running them at the same time... Make sure you don't and you Dispose the client properly before recreating one for the same session.