-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix CI and unstable transport #41
base: master
Are you sure you want to change the base?
Conversation
@aarani do you know why the CI for windows still fails? |
nblockchain's CI sercrets needs an update, for checking out the actual CI result check the results on my fork. |
@aarani |
yeah, It's not implemented but with a simple code change you can use proxies. |
c036eeb
to
e840b42
Compare
e840b42
to
702a94a
Compare
738a849 moves loading of "NumberToSendMessage" property to SendMessage test even though there are 3 other tests that use that variable thereby breaking all 3 tests because of NumberToSendMessage being null. This commit moves the load process back to init phase so all 4 tests can use NumberToSendMessage.
adccfbf
to
92b700e
Compare
We can fix it later when we migrate to .NETCore/.NET5. |
That means I won't be able to keep using TgSharp anymore, since all my projects are .NET 5 or at least .NET Core 3.1. Honestly, who uses .NET Framework anymore... Or then a second option would be to keep the TcpTransport and let the user decide what he wanna use, but that would introduce more complexity than anything else. |
I said we will migrate, but no need to do it in this PR. The smallest this PR is the better, and the earlier we can start merging other PRs. We don't want this PR to become a monster. |
I agree! it's not our bug either, so we either have to try to fix our dependency and PR it or just use another websocket library which we can figure out after this gets merged |
It's just for this PR not permanent. |
603fb2f
to
14fc0eb
Compare
14fc0eb
to
13b3710
Compare
This will fix the retry logic:
I don't have access to this repo therefore I can't do the changes myself for now. |
f98b0d4
to
7326527
Compare
As long as we create a new sessionId for every connection, (by randomizing the sessionId) seqNo can start from 0 and we don't have to save it. This prevents errors like code=32 that are caused by wrong seqNo from happening. This commit also removes the previous workaround that was used on CI to prevent these errors cause they are no longer necessary.
7326527
to
78aa112
Compare
CI is broken now in your branch. |
because my session is now broken |
Let's fix that before you change the retryCount. |
any update on this PR? |
- add response type as generic
09df37c
to
337af08
Compare
src/TgSharp.Core/Network/Message.cs
Outdated
|
||
namespace TgSharp.Core.Network | ||
{ | ||
public class Message |
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.
@aarani nit, should this be internal too?
|
||
uint code = messageReader.ReadUInt32(); | ||
ulong badMsgId = messageReader.ReadUInt64(); | ||
_ = messageReader.ReadUInt32(); |
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.
in HandlePong, you have put a comment explaining why this is ignored (_), can you put a comment here too?
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.
all those comments are mostly old I just ignored some of the unused variables
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.
maybe it's easy to figure out from looking at the spec again for a minute?
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
<dependentAssembly> | ||
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> | ||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" /> |
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.
do all TgSharp consumers need this bindingRedirect now?
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.
I don't know to be honest, I don't think so though
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 this is the case, this is a big annoyance... I wonder if we can fix it
- Upgrade .NET to 4.7.2 to use .NET Standard dependency Reason: https://docs.microsoft.com/en-us/dotnet/standard/net-standard - Uses obfuscated WebSocket transport instead of TCP - Adds asynchronous response handling
337af08
to
0866650
Compare
Last but not least, I'm having trouble finding the MS docs where it recommends to use underscores in method names. |
which methods are you talking about ? |
I can't find the original documentation for it, but event handler name Object_EventName is a fairly old convention. also VS creates event handlers with this same exact naming scheme |
any update? |
Nope, and there will never be. Because knocte always had a urge to control every single misplaced comma or underscore despite wanting to take the lead on open-source projects. Hopefully one day he understands you can't have a desire to lead people and a compulsive behavior to "optimize" everyone's code. I would have loved too as well, sadly you'll never see this PR being merged, mainly for that reason. Everyone eventually got tired and that's it, that's why this project is dead. Props to @aarani for his crazy work on everything else and from the very beginning, without that dude I probably wouldn't even be earning a living the way I'm doing it today. |
Recently CI has been extremely buggy and unreliable, during extensive testing TCP Transport is identified as the culprit.
Errors like
that would happen because of force disconnections right after the first encrypted write.
For this reason and because the transport layer was long overdue for a rewrite we changed the transport to an asynchronous websocket transport + aes-ctr obfuscation