You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a problem. If, when trying to send a request TLRequestGetUserPhotos, the user's photo is located on another DC, the library will migrate the user to the required DC. But on the next request, there will already be a user_migration_error error. The current library functionality in the ReconnectToDcAsync method does not solve this problem in any way.
I came to a solution, just skip files that are on a different DC.
private async Task RequestWithDcMigration(TLMethod request, CancellationToken token = default(CancellationToken), int attempt = 0)
{
if (sender == null)
throw new InvalidOperationException("Not connected!");
var completed = false;
while (!completed)
{
try
{
await sender.Send(request, token).ConfigureAwait(false);
await sender.Receive(request, token).ConfigureAwait(false);
completed = true;
}
catch (DataCenterMigrationException e)
{
//File located on a different DC:
if(e.Message.IndexOf("File located on a different DC:") != -1)
throw new Exception("naher nado poka");
if (Session.DataCenter.DataCenterId.HasValue &&
Session.DataCenter.DataCenterId.Value == e.DC)
{
throw new Exception($"Telegram server replied requesting a migration to DataCenter {e.DC} when this connection was already using this DataCenter", e);
}
await ReconnectToDcAsync(e.DC, token).ConfigureAwait(false);
// prepare the request for another try
request.ConfirmReceived = false;
}
}
}
Help please, can anyone come across this.
The text was updated successfully, but these errors were encountered:
I have a problem. If, when trying to send a request
TLRequestGetUserPhotos
, the user's photo is located on another DC, the library will migrate the user to the required DC. But on the next request, there will already be a user_migration_error error. The current library functionality in theReconnectToDcAsync
method does not solve this problem in any way.I came to a solution, just skip files that are on a different DC.
Help please, can anyone come across this.
The text was updated successfully, but these errors were encountered: