Private images inaccessible after update - quick fix

Hello,

So on Mobile Native, I’ve been facing a blocking issue for several weeks now:
After an update (either OTA or a new build), all private images uploaded via mobile before that update become inaccessible.

Nothing on the forum about it.

After investigating, it turns out that images uploaded via mobile in the LIVE version are actually being uploaded to the DEV version (meaning they appear in the editor only under the DEV environment).

It’s strange because the image’s attached ID doesn’t exist in the DEV environment, yet surprisingly it works perfectly fine with privacy rules and everything.
The issue only appears after updates.

I also noticed that even from the browser, when I try to access an image uploaded before the latest update (by copying its link from the editor into a browser), I get this error:

{"error_class":"DeprecatedVersionError","args":{"code":"xxx","can_update_via_refresh":false,"is_unpaid_app":false},"message":null,"translation":"DEPRECATED_VERSION"}

Obviously, that’s why the image no longer loads.

After reporting this issue to Bubble (with no action taken) and trying several workarounds such as uploading the image as non-private, then re-uploading it server-side, and a few other clunky ideas… I finally found a solution.

It seems that the URL format for private images looks like this:

https://your-domain.com/version-live.0969870980987/fileupload/image_id/image-name.jpg

By removing the version number after version-live, it works again.
The link correctly redirects to the file if the privacy rules allow access; otherwise, you get the standard unauthorized error.

So the quick fix is:
Remove the version ID from the image URL when displaying private images on the front end.

Regex for the find & replace:

/version-live\.[0-9]+/

to

/version-live/

I didn’t make the regex environment-dependent because I only face this issue in LIVE.

About files, I guess it works the same.

Now all images load again, hope this helps, but if you had this issue and found a better solution, I really want to know it.

@nick.carroll defo bug

Yep we are working on a fix!

This topic was automatically closed after 14 days. New replies are no longer allowed.