wordpress-mobile / WordPress-iOS

WordPress for iOS - Official repository
http://ios.wordpress.org/
GNU General Public License v2.0
3.69k stars 1.12k forks source link

SIGABRT: actionButtonTapped > Fatal error: Attempted to read an unowned reference but the object was alrea... #21730

Closed sentry-io[bot] closed 8 months ago

sentry-io[bot] commented 1 year ago

Sentry Issue: JETPACK-IOS-W96

SIGABRT: actionButtonTapped > Fatal error: Attempted to read an unowned reference but the object was already deallocated
  File "ReaderCommentsFollowPresenter.swift", line 204, in ReaderCommentsFollowPresenter.sourceForTracks
  File "ReaderCommentsFollowPresenter.swift", line 199, in ReaderCommentsFollowPresenter.trackNotificationsToggled
  File "ReaderCommentsFollowPresenter.swift", line 96, in ReaderCommentsFollowPresenter.handleNotificationsButtonTapped
  File "ReaderCommentsFollowPresenter.swift", line 141, in ReaderCommentsFollowPresenter.updateNotificationSettings
  File "<compiler-generated>", in thunk for closure
...
(33 additional frame(s) were not displayed)
dvdchr commented 1 year ago

This issue occurred 8 times within the last 30 days. I'm assigning this a medium priority.

From quick investigation, the ReaderCommentsFollowPresenter holds an unowned instance of presentingViewController which was already deallocated when the sourceForTracks() method was called. The stack trace points to a Notice action, so it's possible that the user dismissed the screen while the notice was still shown, and the action button was pressed after that.

A quick fix would be to change presentingViewController to a weak ownership. However, we'd need to put guard conditions on all the methods that call this instance.

sentry-io[bot] commented 8 months ago

Sentry Issue: JETPACK-IOS-1796