Notifications not dismissed when app opened from notification

Bug #1365937 reported by Michał Karnicki
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Telegram app
Fix Released
Medium
Michał Karnicki

Bug Description

clearPersistent method does not work form QML, reported to ralsina as not Q_INVOKABLE. We can't dismiss notifications automatically ATM.

Update: yes, now we can dismiss notificaitons. But if more than one has the same tag, only one of them is dismissed..

Tags: cqa-verified

Related branches

Revision history for this message
Michał Karnicki (karni) wrote :

Roberto (ralsina), John:

Asume we have 4 notifications with such tags.
1. "chat1"
2. "dialog2"
3. "chat2"
4. "dialog2"

When I call clearPersistent(["dialog2"]) I would like both of the notifications to go away. Only one will.

Changed in libqtelegram:
assignee: nobody → Michał Karnicki (karni)
milestone: none → m15
summary: - Notifications not dismissed when app opened directly
+ Notifications not dismissed when app opened from notification
Revision history for this message
Michał Karnicki (karni) wrote :

I updated the bug title to reflect the behavior on Android.

open from notification -> clear notification
open from the launcher -> notifications stay intact (until you open given chat)

Changed in libqtelegram:
status: Triaged → In Progress
Revision history for this message
Roberto Alsina (ralsina) wrote :

This bug looks a bit confusing:

Title: "Notifications not dismissed when app opened from notification", but comment #2: "open from notification -> clear notification" and comment #1 seems to mean it's about clearPersistent not clearing all notifications with a given tag.

So, looking at what comment #1 describes right now.

That looks like a bug in pushclient itself, not on the QML plugin

I am doing some testing now to see if that's the case by trying to clear the tag from dbus, bypassing the QML plugin.

On the OTHER subject of "clearPersistent method does not work form QML, reported to ralsina as not Q_INVOKABLE". I know it's callable from QML because latest version of the hello test app does it:

Revision history for this message
Roberto Alsina (ralsina) wrote :

And after clicking the button:

Revision history for this message
Roberto Alsina (ralsina) wrote :

That however clears ALL tags using an empty list, so I am checking now that it also works when passing it a single tag.

Revision history for this message
Michał Karnicki (karni) wrote :

Robero, I know clearPersistent is now Q_INVOKABLE. The bug description is really old.

What I mean is if there is more than one notification with the same tag, only one is cleared. I hope that is clear and sufficient for you to reproduce.

description: updated
Revision history for this message
Roberto Alsina (ralsina) wrote :

So here's the test I did:

1. changed the app running at http://direct.ralsina.me:8001 to send notifications tagged as "tagname".
2. Send two messages, ending with two persistent notifications
3. changed the app to call clearPersistent(["tagname"])

Result: it clears both notifications

Second test:

1. Send two messages, ending with two persistent notifications
2. changed the app to call clearPersistent(["wrongname"])

Result: doesn't clear the notifications

Third test:

1. Send two messages, ending with two persistent notifications
2. changed the app to call clearPersistent([])

Result: it clears both notifications

All three cases work according to the expected behaviour.

Revision history for this message
Roberto Alsina (ralsina) wrote :

This was supposed to be in comment #3 but it got sent too soon. Here's how the hello test app calls clearPersistent:

http://bazaar.launchpad.net/~ubuntu-push-hackers/ubuntu-push/automatic/view/head:/docs/example-client/main.qml#L298

Revision history for this message
Michał Karnicki (karni) wrote :

"but comment #2: "open from notification -> clear notification" and comment #1 seems to mean it's about clearPersistent not clearing all notifications with a given tag."

- sorry, I don't understant what is not clear. if I open from a notification, this (and all other with the same tag) should be cleared. Only one is. And I use the clearPeristent() method with a single argument, so I'm talking about the very same thing.

Revision history for this message
Roberto Alsina (ralsina) wrote : Re: [Bug 1365937] Re: Notifications not dismissed when app opened from notification

Ok, I just did not understand it then.

On Wed, Jan 28, 2015 at 7:26 PM, Michał Karnicki <
<email address hidden>> wrote:

> "but comment #2: "open from notification -> clear notification" and
> comment #1 seems to mean it's about clearPersistent not clearing all
> notifications with a given tag."
>
> - sorry, I don't understant what is not clear. if I open from a
> notification, this (and all other with the same tag) should be cleared.
> Only one is. And I use the clearPeristent() method with a single
> argument, so I'm talking about the very same thing.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1365937
>
> Title:
> Notifications not dismissed when app opened from notification
>
> Status in Libqtelegram - a qt library to access telegram.:
> In Progress
>
> Bug description:
> clearPersistent method does not work form QML, reported to ralsina as
> not Q_INVOKABLE. We can't dismiss notifications automatically ATM.
>
>
> Update: yes, now we can dismiss notificaitons. But if more than one has
> the same tag, only one of them is dismissed..
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/libqtelegram/+bug/1365937/+subscriptions
>

Revision history for this message
Roberto Alsina (ralsina) wrote :

New test:

1. Set webapp to send notifications with tag "tagname"
2. Sent 3 notifications with that tag
3. Set webapp to send notifiactions with tag "notag"
4. Sent 3 notifications with that tag
5. Set webapp to send notifications with tag "tagname"
6. Sent 3 notifications with that tag
7. Launched hello app, and called clearPersistent(["tagname"])

Result: all the notifications sent with "tagname" are cleared, the ones sent with "notag" are not cleared.

Revision history for this message
Michał Karnicki (karni) wrote :

http://bazaar.launchpad.net/~libqtelegram-team/libqtelegram/app-dev-ui-fixes/revision/232

http://paste.ubuntu.com/9925901/

(that's all of ubuntu-push-client.log output)

Does that mean the push client doesn't even receive the clearPersistent([chatId]) call?

Revision history for this message
Michał Karnicki (karni) wrote :

phablet@ubuntu-phablet:~/.cache/upstart$ system-image-cli -i
current build number: 219
device name: krillin
channel: ubuntu-touch/ubuntu-rtm/14.09-proposed
last update: 2015-01-28 10:49:40
version version: 219
version ubuntu: 20150128
version device: 20150126-cb82dc1
version custom: 20150127-521-24-180

Revision history for this message
Michał Karnicki (karni) wrote :

Roberto, perhaps that single notification is being cleared because I touched it, not because my clearPeristent call is getting through. That's actually what it looks like to me.

Michał Karnicki (karni)
Changed in libqtelegram:
milestone: m15 → none
Revision history for this message
Michał Karnicki (karni) wrote :

As said on IRC, clearPersistent issue sorted out (fault in my JS).

Changed in libqtelegram:
milestone: none → m15
Michał Karnicki (karni)
Changed in libqtelegram:
status: In Progress → Fix Committed
Jonathan Cave (jocave)
tags: added: cqa-verified
Michał Karnicki (karni)
Changed in libqtelegram:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.