Dominux / Pentaract

Unlimited file cloud storage based on using Telegram API
MIT License
298 stars 22 forks source link

The reason of Something went wrong when upload #38

Open sealter opened 2 weeks ago

sealter commented 2 weeks ago

I found many people said something went wrong when upload files, I tried, Yes.

And I check the source and debug upload function to telegram, telegram's response is: "chat not found".

It is becase chat_id. the wiki in https://github.com/Dominux/Pentaract/wiki/Creating-storages , the picture has no 100 before chat_id, and now it has! when we register storage, we should not include 100.

you add 100 in code:

      let chat_id = {
            // inserting 100 between minus sign and chat id
            // cause telegram devs are complete retards and it works this way only
            //
            // https://stackoverflow.com/a/65965402/12255756

            let n = chat_id.abs().checked_ilog10().unwrap_or(0) + 1;
            chat_id - (100 * ChatId::from(10).pow(n))
        };

so if we copy chat_id from web.telegram.org, It already has 100, and there will be 100 twice when send document to telegram.

I test there are some other problem, like greater 20M file, if one chunk fail, other chunks will upload to telegram successfully, the failed one's reason is unknown, the log give me "unknown error".

If upload failed, the storages's query is empty, so in ui the page is no storages.


the project is good, There are many things to learn, but I test it , it cannot use in production or personal.

Thank you, good work. I will give you a star.