K-9: "Mark as read" not working from notification

Created on 28 Nov 2016  路  18Comments  路  Source: k9mail/k-9

Expected behavior

Selecting "mark as read" should mark the email as read and dismiss the notification

Actual behavior

Absolutely nothing!

Steps to reproduce

  1. Send email to self
  2. Expand the notification
  3. Select "Mark as read"

Environment

K-9 Mail version: 5.115

Android version: 6.0.1

Account type (IMAP, POP3, WebDAV/Exchange): IMAP

bug

All 18 comments

Works for me. Probably going to need to see logs to work out what's going on.

It's weird, as it's working for me now, but it definitely wasn't earlier on a number of occasions. I'll see how it goes tomorrow, but as it stands I can't reproduce the problem myself atm.

StatusBar:  Clicked on button 1 for 0|com.fsck.k9|6|null|10117

Cannot send pending intent:
android.content.IntentSender$SendIntentException
at android.app.ContextImpl.startIntentSender(ContextImpl.java:763)
at android.content.ContextWrapper.startIntentSender(ContextWrapper.java:396)
at android.content.ContextWrapper.startIntentSender(ContextWrapper.java:396)
at android.widget.RemoteViews$OnClickHandler.onClickHandler(RemoteViews.java:228)
at com.android.systemui.statusbar.BaseStatusBar$3.onClickHandler(BaseStatusBar.java:352)
at android.widget.RemoteViews$SetOnClickPendingIntent$1.onClick(RemoteViews.java:735)
at android.view.View.performClick(View.java:5204)
at android.view.View$PerformClick.run(View.java:21158)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5461)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

@Valodim: any idea what could have caused this?

Nope. Got a notification, clicked on it, got that trace. Nothing else in logs, mail looks unsuspicious. I tried on a stacked notification of three messages shortly before and it worked

11-30 12:36:19.846 2886 2886 D StatusBar: Clicked on button 1 for 0|com.fsck.k9|6|null|10322
11-30 12:36:19.849 2886 2886 E RemoteViews: Cannot send pending intent:
11-30 12:36:19.849 2886 2886 E RemoteViews: android.content.IntentSender$SendIntentException
11-30 12:36:19.849 2886 2886 E RemoteViews: at android.app.ContextImpl.startIntentSender(ContextImpl.java:739)
11-30 12:36:19.849 2886 2886 E RemoteViews: at android.content.ContextWrapper.startIntentSender(ContextWrapper.java:390)
11-30 12:36:19.849 2886 2886 E RemoteViews: at android.content.ContextWrapper.startIntentSender(ContextWrapper.java:390)
11-30 12:36:19.849 2886 2886 E RemoteViews: at android.widget.RemoteViews$OnClickHandler.onClickHandler(RemoteViews.java:221)
11-30 12:36:19.849 2886 2886 E RemoteViews: at com.android.systemui.statusbar.BaseStatusBar$3.onClickHandler(BaseStatusBar.java:335)
11-30 12:36:19.849 2886 2886 E RemoteViews: at android.widget.RemoteViews$SetOnClickPendingIntent$1.onClick(RemoteViews.java:724)
11-30 12:36:19.849 2886 2886 E RemoteViews: at android.view.View.performClick(View.java:5280)
11-30 12:36:19.849 2886 2886 E RemoteViews: at android.view.View$PerformClick.run(View.java:21239)
11-30 12:36:19.849 2886 2886 E RemoteViews: at android.os.Handler.handleCallback(Handler.java:739)
11-30 12:36:19.849 2886 2886 E RemoteViews: at android.os.Handler.dispatchMessage(Handler.java:95)
11-30 12:36:19.849 2886 2886 E RemoteViews: at android.os.Looper.loop(Looper.java:234)
11-30 12:36:19.849 2886 2886 E RemoteViews: at android.app.ActivityThread.main(ActivityThread.java:5526)
11-30 12:36:19.849 2886 2886 E RemoteViews: at java.lang.reflect.Method.invoke(Native Method)
11-30 12:36:19.849 2886 2886 E RemoteViews: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
11-30 12:36:19.849 2886 2886 E RemoteViews: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

This problem seems to come and go. Marking read was working fine yesterday, broken the day before, and broken again now (tried two consecutive mails today with the same result)

By coincidence as I was typing that, another email turned up. Tried "mark as read" and it worked!
There appears to be no difference in what I'm doing or the emails in question, same result from the lock screen and when unlocked.

In my opinion it is duplicate of #1588. It doesn't matter wheather I hit delete or mark as read on the notification, output in logs is the same:

11-30 21:11:56.249  2858  2858 E RemoteViews: Cannot send pending intent: 
11-30 21:11:56.249  2858  2858 E RemoteViews: android.content.IntentSender$SendIntentException
11-30 21:11:56.249  2858  2858 E RemoteViews:   at android.app.ContextImpl.startIntentSender(ContextImpl.java:867)
11-30 21:11:56.249  2858  2858 E RemoteViews:   at android.content.ContextWrapper.startIntentSender(ContextWrapper.java:415)
11-30 21:11:56.249  2858  2858 E RemoteViews:   at android.content.ContextWrapper.startIntentSender(ContextWrapper.java:415)
11-30 21:11:56.249  2858  2858 E RemoteViews:   at android.widget.RemoteViews$OnClickHandler.onClickHandler(RemoteViews.java:253)
11-30 21:11:56.249  2858  2858 E RemoteViews:   at com.android.systemui.statusbar.BaseStatusBar$4.superOnClickHandler(BaseStatusBar.java:411)
11-30 21:11:56.249  2858  2858 E RemoteViews:   at com.android.systemui.statusbar.BaseStatusBar$4.onClickHandler(BaseStatusBar.java:374)
11-30 21:11:56.249  2858  2858 E RemoteViews:   at android.widget.RemoteViews$SetOnClickPendingIntent$1.onClick(RemoteViews.java:797)
11-30 21:11:56.249  2858  2858 E RemoteViews:   at android.view.View.performClick(View.java:5639)
11-30 21:11:56.249  2858  2858 E RemoteViews:   at android.view.View$PerformClick.run(View.java:22391)
11-30 21:11:56.249  2858  2858 E RemoteViews:   at android.os.Handler.handleCallback(Handler.java:751)
11-30 21:11:56.249  2858  2858 E RemoteViews:   at android.os.Handler.dispatchMessage(Handler.java:95)
11-30 21:11:56.249  2858  2858 E RemoteViews:   at android.os.Looper.loop(Looper.java:154)
11-30 21:11:56.249  2858  2858 E RemoteViews:   at android.app.ActivityThread.main(ActivityThread.java:6095)
11-30 21:11:56.249  2858  2858 E RemoteViews:   at java.lang.reflect.Method.invoke(Native Method)
11-30 21:11:56.249  2858  2858 E RemoteViews:   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
11-30 21:11:56.249  2858  2858 E RemoteViews:   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

In my opinion it happens with e-mails received before (or maybe even during) dozing, and managed by the user after waking from doze. Funny thing is I have

I was able to reproduce it that way:

  1. by sending some test e-mails
  2. waiting fair amount of time to give a chance for entering doze (let's say 1 hour with proximity sensor covered by something)
  3. Waking up and trying to delete or mark as read from notifications.

So far one purposeful reproduction. I'll try once again to check if it reproduces every time.

I'm on 7.1 (official CM-14.1 nighly for Moto G3) with latest K-9 5.115, but this bug was present for me since 6.0 (official firmware by Motorola). I have K-9 excluded from battery optimisation, since it causes for me another trouble with sync, but I'm quite sure this is investigated in another issue.

Now that we have the debug log I'm fairly sure it will be a dupe as it's got nothing to do with the actual action itself. Let's leave both open for now though. I'm personally guessing this is something like duplicated content in Intents or a subtle race condition somewhere (see things like this: http://stackoverflow.com/a/16800592/1052931 ). That's just from the stack and the fact it's intermittent at all.

I'm not going to say don't do the investigation but I suspect the cause of this will be pretty independent of whatever the device is doing.

It also seems to be broken in the other direction. I received an email and opened k9 without tapping on the notification. After reading the email, the notification was still present - the "mark as read" not doing anything either. (this may be duplicate/related to https://github.com/k9mail/k-9/issues/1273)

I have the same symptoms since the update, though I have not had any taps on "mark as read" on the notification work yet. So not intermittent so far. I have no experience debugging K9 but am willing to learn how to produce useful log output if it helps.

I'm having the exact same situation as @philvdb .

Also willing to learn how to provide more details.

Also experiencing this. Google Pixel running Android 7.1.1 and a Nexus 7 running 6.0.1. I'm not sure it's entirely related to #1588 because the issue has only arisen for me during the last month or two (after the recent updates).

The Parcelable extra we use in our PendingIntents seems to be the problem. See https://commonsware.com/blog/2016/07/22/be-careful-where-you-use-custom-parcelables.html

On my MotoG2 with 6.0, patched 01/08/2016 (original Motorola release, not unlocked/rooted) it started again on randomly not clearing the notification.
With 5.206 it has cleared them for the first days, now almost once a day I have to clear them manually.
I have not clearly understood after which steps the notification isn't cleared...

Hey I was able to capture this bug in a log file

04-22 09:00:43.541  2086  2086 E RemoteViews: Cannot send pending intent: 
04-22 09:00:43.541  2086  2086 E RemoteViews: android.content.IntentSender$SendIntentException
04-22 09:00:43.541  2086  2086 E RemoteViews:   at android.app.ContextImpl.startIntentSender(ContextImpl.java:867)
04-22 09:00:43.541  2086  2086 E RemoteViews:   at android.content.ContextWrapper.startIntentSender(ContextWrapper.java:415)
04-22 09:00:43.541  2086  2086 E RemoteViews:   at android.content.ContextWrapper.startIntentSender(ContextWrapper.java:415)
04-22 09:00:43.541  2086  2086 E RemoteViews:   at android.widget.RemoteViews$OnClickHandler.onClickHandler(RemoteViews.java:253)
04-22 09:00:43.541  2086  2086 E RemoteViews:   at com.android.systemui.statusbar.BaseStatusBar$4.superOnClickHandler(BaseStatusBar.java:421)
04-22 09:00:43.541  2086  2086 E RemoteViews:   at com.android.systemui.statusbar.BaseStatusBar$4.onClickHandler(BaseStatusBar.java:384)
04-22 09:00:43.541  2086  2086 E RemoteViews:   at android.widget.RemoteViews$SetOnClickPendingIntent$1.onClick(RemoteViews.java:798)
04-22 09:00:43.541  2086  2086 E RemoteViews:   at android.view.View.performClick(View.java:5637)
04-22 09:00:43.541  2086  2086 E RemoteViews:   at android.view.View$PerformClick.run(View.java:22433)
04-22 09:00:43.541  2086  2086 E RemoteViews:   at android.os.Handler.handleCallback(Handler.java:751)
04-22 09:00:43.541  2086  2086 E RemoteViews:   at android.os.Handler.dispatchMessage(Handler.java:95)
04-22 09:00:43.541  2086  2086 E RemoteViews:   at android.os.Looper.loop(Looper.java:154)
04-22 09:00:43.541  2086  2086 E RemoteViews:   at android.app.ActivityThread.main(ActivityThread.java:6128)
04-22 09:00:43.541  2086  2086 E RemoteViews:   at java.lang.reflect.Method.invoke(Native Method)
04-22 09:00:43.541  2086  2086 E RemoteViews:   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
04-22 09:00:43.541  2086  2086 E RemoteViews:   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)

But I was not able to reproduce. It is pretty rare. Might be related to energy saving stuff in Android.
Android: 7.1.2 (and 7.1.1, 6.0.1)
K9: 5.206
I will try to find a pattern and will continue generating logs :)

I am having this problem since long time ago until now. Currently I am using 5.704 on Android 10.

When tapping reply, it will open K-9 and let me reply. But the notification won't go away until I swipe it away. Same thing happened with delete.

I have excluded K-9 from battery optimization.

There is no other apps behave like this. And they are even battery optimized.

I have tried multiple email client such as Aquamail and FairEmail. Only K-9 behave like this. I have been using a couple of phones, countless ROMs but this issue wont go away.

I will try to find log of it when I have time.

Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Immortalin picture Immortalin  路  3Comments

Kareem-Ahmed picture Kareem-Ahmed  路  3Comments

D0ve picture D0ve  路  3Comments

philipwhiuk picture philipwhiuk  路  3Comments

robsmith11 picture robsmith11  路  3Comments