Memmy-App / memmy

An Apollo inspired open-source iOS and Android client for Lemmy built with React-Native. Find us on the App Store and Google Play!
GNU Affero General Public License v3.0
547 stars 58 forks source link

[Bug]: Crash in feed listing of !Linux@lemmy.ml #1073

Closed dpoon closed 8 months ago

dpoon commented 8 months ago

Check for open issues

Minimal reproducible example

When viewing the feed listing for !Linux@lemmy.ml, version 1.1.2 (86) crashes.

To help identify the post that triggers the crash, I've changed to large fonts and non-compact view to reduce the number of posts shown. After varying the sort order and comparing against the feed in Lemmy's web interface, I'm suspecting "Who uses pure GNOME (no extensions)", because:

Expected Behavior

App shouldn't crash.

Version

1.1.2 (86)

App Store or TestFlight?

TestFlight

iOS Version

16.x

Device

iPhone 13 mini

gkasdorf commented 8 months ago

Interesting. Tried to follow that repro and I do see that post, but am not getting the crash (on my phone). Let me try it out on a difference device and see.

gkasdorf commented 8 months ago

Ok, I repro'd it in the simulator. Odd that it's not happening on my device though. Let me look into it 👍

gkasdorf commented 8 months ago

😅 So this is fun! Went ahead and tried catching native errors and found the crash to be here:

Screenshot 2023-11-07 at 11 07 16 AM

Well that's a great way to explain the error!

I do notice though that you're on iOS 16 and that's why I set up an iOS 16 simulator. Wondering if this was fixed in iOS 17 and that is why I don't get the crash there.

The image in question is this: https://upload.wikimedia.org/wikipedia/commons/1/1b/Linux_Distribution_Timeline.svg which does load fine for me on my device.

I suppose what I'll have to do for now is not render SVGs for users on iOS 16 or lower and instead just offer the link to the image in the browser (honestly shouldn't be a very common thing at all anyway). Might be able to use a different library to render the SVGs as well, so I'll look into that.

Looks like this only results in a crash if the image is cached to memory. I was actually only experimenting with memory caching anyway, and I'm not seeing a significant difference between a memory-disk cache vs a disk-only cache, so we will just revert back to the disk cache.

Thank you for the excellent repro!

gkasdorf commented 8 months ago

Fixed https://github.com/Memmy-App/memmy/commit/be06a94226a95add6c9797ee809d00087ee899b3