ubports / telegram-app

Unofficial Telegram App for Ubuntu Desktop & Mobile
GNU General Public License v3.0
55 stars 23 forks source link

Uploading images order is strange #74

Open alexanderisme opened 7 years ago

alexanderisme commented 7 years ago

When you send some photos (more than only one) on telegram the photos are not sent in the chronological order (=by date). I don't know which rule is applied for the upload order. I have tested to send the same photos from the camera app and the gallery app, in both cases the photos are uploaded in the same order. This is really annoying if you send for example many images because it is confusing (maybe from a book, and you have the page 10 before the page 5! Or with holiday photos, and you have a photo of a beach, then a castle, than the beach again, than the castle...)

How is the order for the upload of the images chosen? Could it be set to a chronological order?

Flohack74 commented 7 years ago

Hi,

I can understand what you mean. It´s just a bit difficult to find the optimal solution: If you look for the date, which date to take? Date of creation, modify? Date of EXIF info inside, if applicable?

The next problem is, pictures are coming via content hub as copies from the originals. Apps can only share by this method. I assume that´s the source of the problem, the date could be overwritten by the content hub exchange, and so I see no usable date in Telegram. But let me check. also @sverzegnassi what do you think about this?

sverzegnassi commented 7 years ago

@Flohack74 Not sure, but I don't think ContentHub performs any manipulation of the list of transferred items. In case of transfer from gallery-app, I guess it's gallery-app that might be sorting items as they appear in its internal ListModel (i.e. does gallery-app sort items by date?). Moreover, I wouldn't exclude that telegram-app might re-sort items as they get uploaded on the server (it's still an asynchronous operation with unpredictable outcome). In any case, I saw the same behavior on Android, using WhatsApp, so it might be a non-trivial bug to fix.

About ContentHub in general, we might want to prioritize our review of the whole content sharing infrastructure (i.e. ContentHub, AppArmor confinement, and url-dispatcher), since I have the feeling this could become an handicap in a non-remote future.

ruedigerkupper commented 6 years ago

Might be a different issue but I have experienced this when sending one image after the other. Here, you have a well-defined order (the one in which I sent them). Still, this order is not preserved. Depending on connection and image size, images take a different time to upload. Each image seems to get sent as soon as it is fully uploaded, which means that an image sent later may well arrive earlier than the others. You would have to wait for every single image to fully upload to have a guaranteed order.

Flohack74 commented 6 years ago

Now I remember we had the same bug with forwarded messages. Let me check whats going on there ;)

Flohack74 commented 6 years ago

@ruedigerkupper by the way, what you describe about the upload delay results in a different order, can you try this with the official App or desktop App? Because its clear, the server will take "Sent" date as when the upload finished, I assume. This is why official Apps have no this kind of mini gallery funtion maybe...