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

OnOther action dosent work #175

Closed AgentBelfort closed 1 year ago

AgentBelfort commented 1 year ago

I've already posted here before with an error -> https://github.com/wiz0u/WTelegramClient/issues/129 Then I did not solve the error, for some reason my OnUpdate method did not receive ReactorError Now when I get the error "You must connect to telegram first" again, I discovered and opened this issue: https://github.com/wiz0u/WTelegramClient/issues/157 I updated the library to version 3.5.2-dev.20, however it didn't help me. Method Client_OnOther for some reason still not being called after calling Dispose. I have tried this on my app and also on "Fatal reactor error" demo app: image Why might a method Client_OnOther not be called?

AgentBelfort commented 1 year ago

Previously (when there was only one OnUpdate signal), I got updates about new messages etc. but never got a ReactorError update, now this problem persists.

wiz0u commented 1 year ago

The issue with ReactorError not being correctly raised was fixed in 3.5.2-dev.1 and later

In any case, by design, ReactorError is not raised AFTER you call Dispose. I think you got things backwards.

ReactorError can be caused by fatal errors (like non-transient network loss) while the client is running when it's about to stop working. And THEN while YOU handle such ReactorError in your OnOther handler, the recommended action is that you call Dispose.

AgentBelfort commented 1 year ago

I tested calling a OnOther signal on your code template, and I can't seem to get the OnOther signal to be called. Where could be the error?

wiz0u commented 1 year ago

PEBKAC