Avoid crash on notification worker (#4025)

Not quite sure why/when this happens - every stack trace is not our
code, but I do get an ClassNotFoundException for Notification$Type with
the new reverted code.

The notification fetching (worker) then stops/crashes so I never get an
Android notification.

It might have something to do with
https://github.com/tuskyapp/Tusky/pull/3732 ?
This commit is contained in:
UlrichKu 2023-09-25 09:44:01 +02:00 committed by GitHub
commit 82bc48c3ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View file

@ -249,7 +249,7 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidInje
} else if (accountRequested && intent.hasExtra(NOTIFICATION_TYPE)) {
// user clicked a notification, show follow requests for type FOLLOW_REQUEST,
// otherwise show notification tab
if (intent.getSerializableExtra(NOTIFICATION_TYPE) == Notification.Type.FOLLOW_REQUEST) {
if (intent.getStringExtra(NOTIFICATION_TYPE) == Notification.Type.FOLLOW_REQUEST.name) {
val intent = AccountListActivity.newIntent(this, AccountListActivity.Type.FOLLOW_REQUESTS)
startActivityWithSlideInAnimation(intent)
} else {
@ -1102,7 +1102,7 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidInje
@JvmStatic
fun openNotificationIntent(context: Context, tuskyAccountId: Long, type: Notification.Type): Intent {
return accountSwitchIntent(context, tuskyAccountId).apply {
putExtra(NOTIFICATION_TYPE, type)
putExtra(NOTIFICATION_TYPE, type.name)
}
}