Piwigo / Piwigo-Mobile

Piwigo iOS Mobile Application
MIT License
98 stars 30 forks source link

[BUG] Failed video uploads grows iOS disk usage outside of Piwigo cache #534

Closed joelkj closed 7 months ago

joelkj commented 1 year ago

I tried to upload a larger (8 minute/950MB roughly) video from an Iphone (IOS 16.4.1, Piwigo Mobile 2.12.7 & server 13.6.0) that repeatedly failed. Unsure why the upload itself failed, might have been the file size as several smaller uploads were succcessful prior to this. What I did notice though was that Piwigo after each unsuccessful uploaf grew its disk usage on the IOS device very considerably, probably roughly equating to the incremental size of the failed uploads. Despite clearing the cache, restarting the app and even restarting the phone the disk usage remained the same, see attached screenshots. I tried searching for similar issues but found nothing. Does Piwigo cache the upload locally, and is this behavior expected when an upload fails? I would have thought the data would be discarded at that point.

IMG_3045 IMG_3046

EddyLB commented 1 year ago

Hi @joelkj

After having checked the source code of the app v2.12.7, I confirm that the cache size indicated in Settings does not take into account the size of the files prepared for uploads.

A large photo or video file is split in chunks stored in a special folder before upload. These chunks are immediately erased after completion of the upload, not after a failure. If you try re-uploading the photo/video, the old chunks are replaced by new ones. And if you erase the upload request, the chunks should be erased with it.

EddyLB commented 10 months ago

With version 3.0.2, deleting a failing upload request also deletes the corresponding chunks stored temporarily in the device.

Version 3.1 will bring an option for deleting the upload cache, chunks included.