-
Notifications
You must be signed in to change notification settings - Fork 380
address an issue with the datacenter selection... #938
Conversation
@knocte is my concern clear now why we should push the other fix first? |
not clear man, what would happen if I merge only the line that filters the MediaOnly DCs and not the session save? what happens in that case? |
it works. then when you push fix 937 it won't work. because you need the line session.save |
i don't know what else i can say, try it if you don't believe/understand/unsure of what i am saying. i have been debugging for hours and now also documenting it for many more hours. |
It's not that I don't believe you, it's that I want to understand before merging.
Well, then I will merge first a commit filtering the MediaOnly, whose commits message says that it fixes bug #935. After that, I'll modify PR 937 to include that Save() call. And we're done. And each commit fixes a separate thing. Ok with this? |
TLSharp.Core/TelegramClient.cs
Outdated
@@ -134,8 +136,9 @@ private async Task ReconnectToDcAsync(int dcId, CancellationToken token = defaul | |||
|
|||
var dataCenter = new DataCenter (dcId, dc.IpAddress, dc.Port); | |||
|
|||
transport = new TcpTransport(dc.IpAddress, dc.Port, handler); | |||
transport = new TcpTransport(dc.IpAddress, dc.Port, handler); // this will be gone after fix #937 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you keep this line after fix 937, it will be useless because the connectionAsync on line 140 will cause a recreation of the TcpTransport
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right so then this has to be fixed in the PR#937, not in the same commit that does the MediaOnly filter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok then
let's go ahead.
nothing personal, ok, i am a very direct and at the same time sincere person.
cheers
TLSharp.Core/TelegramClient.cs
Outdated
session.DataCenter = dataCenter; | ||
session.Save(); // this is needed after fix #937 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you don't save the session, the new tcpTransport created inside connectAsync (firx 937), will reload the session with the old datacenter value
that could select datacenters which were not supporting standard communication