Troubleshoot image load and display issues

This is the first time I’m working with image media and they don’t seem to be loading properly. I’ve used both HEIC and JPG as images, and the app demo both on a desktop and an iPhone XR.

When creating an Announcement, a user can add pictures, these pictures are displayed along with the Announcement (Media > Current Announce).

2 collections are used to display the images:

  • Announcement has many-to-many relationship to Media
  • Media stores the picture

There seems to be 2 issues:
A. Pictures show up, then disappear once the page loads and never reappear.
B. The most recent picture displays in all pictures slots.

See the screenshots below for what the issue looks like. It doesn’t seem to make sense.

(Issue B) Immediately after posting announcement, image shows up in in all pictures.

(Issue A) 3 minutes after post, or after the page reloads, none of the pictures load again.

(Issue B-related) The Media collection shows that the picture is only related to 1 announcement.

(Issue B-related) The list is pulling Media>Current Announcement, and not all Media.

Any help or troubleshooting is welcome. Thanks!

Hi @wes,

As a general suggestion - do you think you can change your DB structure so that it has 1:many relationship between Media and Announcements? Given the nature of your app’s business process, I think this could be done (user upload several pictures for 1 announcement, and each picture belongs uniquely to the announcement).

The thing is, that in my experience, M:M relationships in Adalo could work quite slowly. Not going deep into the technology reasons, I’d say that in any relational database such relationships are “not natural” and therefore are implemented via some hacks/workarounds. IBM says something like “if you need m2m relationship, then your database design is wrong” :slight_smile: :slight_smile: :slight_smile:

So, my advice would be to try testing an alternative DB design and then see if the problem persists.

Best regards, Victor.

Thanks Victor! After implementing the 1:many relationship the issues were resolved.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.