I have an issue with a page from my app. It is a photo gallery, that has no issue on laptop, but crashes constantly after 10s on mobile iOS
Here is the thing :
I display a list of “pictures” that are DB elements containing an image but also other infos (name, date, album).
I created a pagination of the RG to avoid loading pain. So when page is loaded. I do a search for “photo” filtered “this album” items until 100 on mobile, 200 on laptop.
When user clicks “see more” it loads 100 or 200 more
This worked very well until today.
I implemented a new function that allows to identify bibs on photos.
When bibs are taged, the photo element becomes “taged=yes” and an element “bib” is linked to the element “photo”. This bib element contains infos such as album, bib numbers, competition etc
So now, when a user loads an album without bibs, even a large one, there is no crash.
But with my new album that contains bibs, The iOs page keeps crashing after 10 seconds, even when I run 0 actions.
Could you have an idea where this comes from ?
Please note that this album contains 4470 photos, but only 100 are loaded at crash
Also note that previous albums with arround 3000 photos had latency in loading, but never recurrent crash like this.
The issue seems to be coming from the number of elements, as another album with same specs works fine with 1780 photos. But i dont get how to reduce this knowing that my RG is already paginated to 100 or 200 items
OK so the issue was that I had 2 elements that used logic/calculation based on a “count” function with filters. With the number of elements going up, it created bugs that did not exist with less elements. Removing them allowed the page to stabilize and stop crashing
I think it’s pulling in too much now. Maybe you added a lot of photos recently?
You probably shouldn’t be pulling in all the photos, then filtering. Try to add a constraint instead of using Filter so the filtering happens on the server side instead of the browser side.
Using :filter means that you pull in all the data in your database based on constraings and privacy rules into the browser, then you do that filter. So this could break if you have too many images.
If you add a constraint on the search, then it filters on the server first before downloading to your browser.
Yes i tried this before to display my data from a “do a search for” function instead of filtering the list, which made the page faster but did not fix it all, as I explained above I had some logic and elements based on a “count” function with filters, which led as you said to fetching the whole list of 4700 photos instead of just the targeted ones