Even if you're not supposed to use multiple threads with TLSharp,
it might be worth it to try to make this sequence increment in
a thread-safe way. Race conditions are always bad even if you know
you are not supposed to use something in a certain way...
@Laituex was having a ErrCode=32 'msg_seqno too low' problem and this
is the first thing we looked at (even if he swore that he was not
using different threads to access the telegram network).
(Backported from 881bdd27a5 )
# Conflicts:
# src/TgSharp.Core/Session.cs
The reason for such a hack when runing in CI is because we
need to make sure we're using higher sequence numbers than
any previous times (and even previous runs of the test suite).
And we run 1 test only for now, later we will enable more.
Other notes:
The trick to extract secrets to files was taken from:
https://stackoverflow.com/a/59482124/544947
The binary-to-text encoding/decoding was taken from:
https://stackoverflow.com/a/42725926/544947
The way to add defines to DefineConstants for MSBuild:
https://stackoverflow.com/a/5053070/544947