mtproto
mtproto copied to clipboard
Should remove the panic?
The panic in this code looks like used for debugging. I guess that should remove it?
https://github.com/xelaj/mtproto/blob/04ee89d1b6bce00fb50e4e87bf16fdc781cf4d8f/mtproto.go#L364-L367
@waybackarchiver well, yes, but no. BadMsgNotification means that all session was broken, i mean, this message should be never received from official telegram servers. if we got it, then something in package is broken.
Soooo, idk, maybe we need to leave for now... Or remove it, cause i hate panics in community modules too...
I don't know, need to decide what to do with it.
As I understand it, we should provide this panic as an error to the caller to handling, and not have them interrupted.
But I haven't encountered this yet, so maybe I'll consider it later if we need to.
return error (or mark session is in bad state) and let app decide what to do (panic or reconnect/recreate session). at this time I've been forced to separate app logic using different processes because of mtproto panics (lost connection/BadMsgNotification whatever)