metatext icon indicating copy to clipboard operation
metatext copied to clipboard

Crash when muting profile you follow

Open jbalint-de opened this issue 3 years ago • 2 comments

Description: App crashes when muting a profile you follow

Steps to reproduce the behavior:

  1. Go to profile you follow
  2. Mute profile
  3. App crashes

Expected behavior: App shouldn't crash.

  • Device: iPhone 6S

  • OS: iOS 15.0.2

  • App Version: 1.5.0 (4)

  • [x] I looked for duplicate issues.

jbalint-de avatar Oct 15 '21 07:10 jbalint-de

I looked first to see if my issue was here, and this is close.

Crash when muting profile.

Tap on any user’s profile in your feed. Mute them. Keep default options, tap Mute to save.

App immediately crashes, when you open it the Mute was successful.

It shouldn’t crash.

iPhone 13 pro, iPadOS 15.7.1, Metatext 1.5.3. Bug_type is 309

cdenesha avatar Nov 16 '22 03:11 cdenesha

I don't know the root cause for this crash, however, I was able to reproduce it sometimes and to get some insight into what happens.

The crash happens in CollectionItemsViewModel.swift, in function viewModel(indexPath: IndexPath) -> Any:

public func viewModel(indexPath: IndexPath) -> Any {
    let item = lastUpdate.sections[indexPath.section].items[indexPath.item] // <-- items is empty, ergo: array index out of bounds for index 0
    let cachedViewModel = viewModelCache[item]
    // ...
}

I notices that when muting a profile from the profile page (and the app doesn't crash for once), none of the account's toots are shown anymore (the profile is shown, but without any posts). They only become visible again when refreshed by pulling down. This might have to do with the error, perhaps because some cache is invalidated (?) or so.

vollkorntomate avatar Nov 17 '22 10:11 vollkorntomate