Piwigo / Piwigo-Mobile

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

[BETA 3.0] Feedback | Random crash while loading images #533

Closed benjaminchodroff closed 1 year ago

benjaminchodroff commented 1 year ago

Describe the bug and how to reproduce Application crash while loading many images into cache

Steps to reproduce the behavior: Load photos from https://benchodroff.com/photos/ without login, and open Guizhou 2023 albumb Start swiping across each photo to start loading them all into cache Application will crash

Expected behavior No crash

What did you do already Tried again, keeps crashing

Smartphone (please complete the following information):

EddyLB commented 1 year ago

@benjaminchodroff I am unable to reproduce the crash with the simulator and my devices. Most downloads fail because of a network timeout and that's it.

The default size for previewing photos on an iPhone 12 Pro Max is "Full Resolution" which leads to the download of large files. Can you please select the Photos / Preview File size "Huge" instead of "Full resolution" in Settings as shown below and tell me if the app still crashes.

image

benjaminchodroff commented 1 year ago

Switching to Huge fixed the problem - no more crashes. Switching back to Full Resolution (even though all the photos are cached) causes the crash to reappear.

EddyLB commented 1 year ago

Thank you very much for the tests. Have you reported the crashes with TestFlight? I would like to try to fix this issue.

benjaminchodroff commented 1 year ago

Oddly enough, this particular crash is not triggering any TestFlight notice to send logs. The app completely disappears and I'm back at home - but the app is still running. Not sure what else to try!

EddyLB commented 1 year ago

Thank you for the infos. Could you please repeat the same tests with this Piwigo website.

benjaminchodroff commented 1 year ago

I hit every photo in every album in the piwigo website, but sadly the crash did not happen even though I had it set to full resolution. I guess it may either be related to either my cache size for my website was very large (over 2GB for mine, whereas yours is only caching ~150MB for photos), or the size of my full resolution photos are much larger than yours (mine can easily be >20MB at full resolution)

benjaminchodroff commented 1 year ago

After setting it back to my Piwigo, and swiping very quickly through Guizhou 2023 with a clear cache, it soft crashed again. It appears to be related to the large photo size and swiping very quickly. I tried multiple other albums and was unable to reproduce the crash.

EddyLB commented 1 year ago

Thank you @benjaminchodroff for these tests. I will try to reproduce them with very large photos.

EddyLB commented 1 year ago

Hi @benjaminchodroff After some investigations, the crash is due to the amount of RAM required to handle very large photos. iOS kills the app when it starts using too much memory. The next build of the version 3.0 will fix this issue.

benjaminchodroff commented 1 year ago

Confirmed, the latest build has fixed the issue. Thank you!

On Mon, May 8, 2023 at 2:46 AM Eddy Lelièvre-Berna @.***> wrote:

Hi @benjaminchodroff https://github.com/benjaminchodroff After some investigations, the crash is due to the amount of RAM required to handle very large photos. iOS kills the app when it starts using too much memory. The next build of the version 3.0 will fix this issue.

— Reply to this email directly, view it on GitHub https://github.com/Piwigo/Piwigo-Mobile/issues/533#issuecomment-1537515173, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBU6RTB7J73EELVK7ZT3DLXE7UZXANCNFSM6AAAAAAXYCLS4M . You are receiving this because you were mentioned.Message ID: @.***>

EddyLB commented 1 year ago

Great! Thank you.