steavy29 / Telegram.Net

Telegram (http://telegram.org) client library implemented in C#.
17 stars 6 forks source link

DC Invalid when trying to download image #36

Closed gviddy closed 7 years ago

gviddy commented 7 years ago

When I call GetFile() I am getting the following error.. It is an image that I am trying to download...

Throwing exception for request AuthExportAuthorizationRequest because of error BadRequest - DC_ID_INVALID

steavy29 commented 7 years ago

Hi. Which session storage do you use? In-file?

gviddy commented 7 years ago

Yes, created a simple File Session Store....

steavy29 commented 7 years ago

Did you try to clear it?

gviddy commented 7 years ago

I've deleted the app and deployed it brand new to the device. Would that be doing the same thing?

Do you think it's more to do with saving the file than the DC id being wrong somehow ?

steavy29 commented 7 years ago

No, I'm just trying to collect more data on this - whether problem is in corrupted session file or in request itself. So it looks like to be a problem with request.

gviddy commented 7 years ago

Yes it fails in the following function.....

public async Task<UploadFileConstructor> GetFile(FileLocationConstructor fileLocation, int offset, int limit)
        {
            var request = new GetFileRequest(new InputFileLocationConstructor(fileLocation.volumeId, fileLocation.localId, fileLocation.secret), offset, limit);
            await SendRpcRequestInSeparateSession(fileLocation.dcId, request);

            // only single implementation available
            return (UploadFileConstructor)request.file;
        }

When it does the SendRpcRequest...... And then within that function it fails on the following line....

await SendRpcRequest(exportAuthRequest);

Unfortunately I just don't understand any of that RpcRequest stuff... so would be great to hear if you have any ideas what might be going wrong.....

gviddy commented 7 years ago

The error is: Throwing exception for request AuthExportAuthorizationRequest because of error BadRequest - DC_ID_INVALID

steavy29 commented 7 years ago

Hi. Can you share your session.dat with me(in private) so that I could reproduce this issue?

gviddy commented 7 years ago

oh I am running on an Android device... I am not sure if that is possible ?

steavy29 commented 7 years ago

If you're using FileSessionStore, then you should be able to find that file. Could you check please?

gviddy commented 7 years ago

yep, got it... how do I send it to you ?

steavy29 commented 7 years ago

Please, find me in Telegram https://t.me/steavy29

steavy29 commented 7 years ago

Should be fixed now. Please verify.

gviddy commented 7 years ago

Yes, this has fixed the error.... thank you! 👍