Skip to content

[WIP][BREAKING CHANGE] api: Update to Layer 108#5

Closed
aarani wants to merge 12 commits intonblockchain:masterfrom
aarani:master
Closed

[WIP][BREAKING CHANGE] api: Update to Layer 108#5
aarani wants to merge 12 commits intonblockchain:masterfrom
aarani:master

Conversation

@aarani
Copy link

@aarani aarani commented Apr 3, 2020

No description provided.

@aarani
Copy link
Author

aarani commented Apr 3, 2020

Needs Testing.
Password authentication support removed.

@knocte
Copy link
Member

knocte commented Apr 3, 2020

@aarani good work!

@CheshireCaat hey you might be interested in this, can you help us test it?

@aarani : by the way, as far as I understand, this PR has 2 parts: one which you updated manually, and the other one which you updated automatically via the generator, can you explain how did you do the latter?

@aarani
Copy link
Author

aarani commented Apr 3, 2020

@aarani : by the way, as far as I understand, this PR has 2 parts: one which you updated manually, and the other one which you updated automatically via the generator, can you explain how did you do the latter?

Our generators is a little idiot that cause it's generated code to be unusable without manual modifications. for now before that we can fix it all generated codes need to be formatted and it's errors must be fixed manually and as this layer has a lot of changes it breaks the TelegramClient wrapper which I had to fix too

@knocte
Copy link
Member

knocte commented Apr 3, 2020

@aarani I see, but still, how did you call the generator?

@aarani
Copy link
Author

aarani commented Apr 3, 2020

@aarani I see, but still, how did you call the generator?

Nothing crazy, just run "TLGenerator <path_to_json_schema>"

@aarani aarani changed the title api: Update to Layer 108 [BREAKING CHANGE] api: Update to Layer 108 Apr 3, 2020
@knocte
Copy link
Member

knocte commented Apr 3, 2020

Nothing crazy, just run "TLGenerator <path_to_json_schema>"

And where to get the json schema?

@aarani
Copy link
Author

aarani commented Apr 3, 2020

Nothing crazy, just run "TLGenerator <path_to_json_schema>"

And where to get the json schema?

Telegram started updating their documentation and they now have the schema json on their website before that you had to extract it from webogram config files

@knocte
Copy link
Member

knocte commented Apr 3, 2020

are you sure? check the PR 906 of TLSharp

@aarani
Copy link
Author

aarani commented Apr 3, 2020

are you sure? check the PR 906 of TLSharp

of course. afaik there is no need to update anything else to use new layers. we need to support mtproto 2.0 but that's story for another day for now just updating the api is enough

@knocte
Copy link
Member

knocte commented Apr 3, 2020

are you saying that the current schema in https://core.telegram.org/schema/json is only MTProto2.0 compatible and TLSharp/TgSharp is not MTProto2.0 compatible yet?

@aarani
Copy link
Author

aarani commented Apr 3, 2020

are you saying that the current schema in https://core.telegram.org/schema/json is only MTProto2.0 compatible and TLSharp/TgSharp is not MTProto2.0 compatible yet?

I'm exactly saying the opposite. It's compatible with both MTProto versions and using it doesn't need any other changes except changes to schema and models

@knocte
Copy link
Member

knocte commented Apr 3, 2020

except changes to schema and models

what changes to schema and models?

@aarani
Copy link
Author

aarani commented Apr 3, 2020

what changes to schema and models?

changes that I did inside this pull request

@knocte
Copy link
Member

knocte commented Apr 3, 2020

You mean the changes after running the generator?

@aarani
Copy link
Author

aarani commented Apr 3, 2020

You mean the changes after running the generator?

Yup

@knocte
Copy link
Member

knocte commented Apr 3, 2020

So then the exact instructions are:

right?

@aarani
Copy link
Author

aarani commented Apr 3, 2020

So then the exact instructions are:

right?

and fix all the errors that TLGenerator made and change all the legacy methods that are removed from previous layers that will cause TelegramClient.cs to break and change TelegramClient.cs#83 to let telegram know what version of api we're using to communicate

@knocte
Copy link
Member

knocte commented Apr 3, 2020

and fix all the errors that TLGenerator made and change all the legacy requested that are removed from previous layers that will cause TelegramClient.cs to break and change TelegramClient.cs#83 to let telegram know what version of api we're using to communicate

I was asking how to just run the generator, not how to fix the mess later (that was already clear).
I'll run it myself anyway to understand these kind of manual changes that need to be done after, thanks.

@aarani aarani changed the title [BREAKING CHANGE] api: Update to Layer 108 [WIP][BREAKING CHANGE] api: Update to Layer 108 Apr 3, 2020
@aarani
Copy link
Author

aarani commented Apr 3, 2020

I was asking how to just run the generator, not how to fix the mess later (that was already clear).
I'll run it myself anyway to understand these kind of manual changes that need to be done after, thanks.

I was just describing the protocol, sure you're welcome

@knocte
Copy link
Member

knocte commented Apr 6, 2020

@aarani do you mind fixing the conflicts, and adding this to the README file: #5 (comment)

@knocte
Copy link
Member

knocte commented Apr 8, 2020

@aarani do you mind fixing the conflicts, and adding this to the README file: #5 (comment)

ping

@solarin
Copy link

solarin commented Apr 8, 2020

Telegram requests to change DC, the software tries to do it -->

System.IO.EndOfStreamException: Unable to read beyond the end of the stream.
at System.IO.BinaryReader.FillBuffer(Int32 numBytes)
at System.IO.BinaryReader.ReadInt64()
at TgSharp.Core.Network.MtProtoPlainSender.d__6.MoveNext() in \TgSharp\src\TgSharp.Core\Network\MtProtoPlainSender.cs:line 51
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at TgSharp.Core.Auth.Authenticator.<DoAuthentication>d__0.MoveNext() in \TgSharp\src\TgSharp.Core\Auth\Authenticator.cs:line 39 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
at TgSharp.Core.TelegramClient.d__12.MoveNext() in \TgSharp\src\TgSharp.Core\TelegramClient.cs:line 90
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
at TgSharp.Core.TelegramClient.d__13.MoveNext() in \TgSharp\src\TgSharp.Core\TelegramClient.cs:line 155
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
at TgSharp.Core.TelegramClient.d__14.MoveNext() in \TgSharp\src\TgSharp.Core\TelegramClient.cs:line 187
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
at TgSharp.Core.TelegramClient.d__16.MoveNext() in \TgSharp\src\TgSharp.Core\TelegramClient.cs:line 206
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at GroupCasher.GroupManager.d__17.MoveNext() in source\repos\GroupCasher\GroupCasher\GroupManager.cs:line 142

@solarin
Copy link

solarin commented Apr 8, 2020

this is happening with my Emirati number, i can give it to you for testing purposes

@knocte
Copy link
Member

knocte commented Apr 9, 2020

@aarani how can a layer update cause transport/connection issues?

@aarani
Copy link
Author

aarani commented Apr 9, 2020

@solarin have you changed any codes? maybe some connection issue? do you use something like vpn or proxy of some sort?
@knocte it can't afaik and i tested dc switch it worked properly

@knocte
Copy link
Member

knocte commented Apr 9, 2020

@aarani turns out Mario (@solarin) has told me that this connection issue is only happening for him for his number from Dubai, but doesn't happen with others (e.g. Vietnamese). He seems to be willing to give you the code so you can debug on your side

@solarin
Copy link

solarin commented Apr 9, 2020

@solarin have you changed any codes? maybe some connection issue? do you use something like vpn or proxy of some sort?
@knocte it can't afaik and i tested dc switch it worked properly

no, i did not.

but honestly i didn't try if the problem also exists with layer66. let me see. sorry

@knocte knocte force-pushed the master branch 2 times, most recently from d1297ff to b5ca41f Compare April 14, 2020 13:53
@aarani
Copy link
Author

aarani commented Apr 15, 2020

@knocte Please push this already and just create a legacy branch for 2FA Users

@aarani
Copy link
Author

aarani commented Apr 15, 2020

Hey.
Is it possible to implement Two-factor authentication on the last layer?
The password verification algorithm has become more complicated after layer 66.

That will be on roadmap as soon as this pr get merged, feel free to create a pr for it

@knocte
Copy link
Member

knocte commented Apr 15, 2020

create a legacy branch for 2FA Users

Well, let's consider TLSharp the legacy branch? I'm not doing fixes to that repo anymore.

@knocte
Copy link
Member

knocte commented Apr 15, 2020

Please push this already

I'm not comfortable pushing this if the generator is not in sync with what is being generated here, I'm trying to understand why, first.

@aarani
Copy link
Author

aarani commented Apr 15, 2020

Please push this already

I'm not comfortable pushing this if the generator is not in sync with what is being generated here, I'm trying to understand why, first.

Have fun

@knocte knocte force-pushed the master branch 4 times, most recently from 13c61a3 to 605f368 Compare April 16, 2020 09:48
@knocte
Copy link
Member

knocte commented Sep 11, 2020

Superseded by #13 , sorry for the long delay!

@ahmedibrahimsaadmostafa
Copy link

How I can login after registration? I want login after close my windows app. By which method I can check in session file? this is my code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants