After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 683449 - Misc fixes to Telepathy chats
Misc fixes to Telepathy chats
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: telepathy
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME Shell Telepathy maintainer(s)
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2012-09-05 21:15 UTC by Giovanni Campagna
Modified: 2012-11-28 16:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
TelepathyClient: don't emit an error if an unknown message is acknowledged (1.03 KB, patch)
2012-09-05 21:17 UTC, Giovanni Campagna
committed Details | Review
TelepathyClient: ignore invalid message id errors (1.30 KB, patch)
2012-09-05 21:17 UTC, Giovanni Campagna
none Details | Review
GrabHelper: always navigate focus when grabbing (991 bytes, patch)
2012-09-05 21:18 UTC, Giovanni Campagna
none Details | Review
MessageTray: fix keybinding for fixed GrabHelper (1.47 KB, patch)
2012-09-05 21:23 UTC, Giovanni Campagna
none Details | Review
GrabHelper: always navigate focus when grabbing (987 bytes, patch)
2012-09-05 22:04 UTC, Giovanni Campagna
committed Details | Review
Telepathy: ignore errors from ack_all_pending_messages() (1.20 KB, patch)
2012-11-26 21:33 UTC, Giovanni Campagna
none Details | Review
Telepathy: ignore errors from ack_all_pending_messages() (1.20 KB, patch)
2012-11-26 21:40 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2012-09-05 21:15:19 UTC
See patches
Comment 1 Giovanni Campagna 2012-09-05 21:17:23 UTC
Created attachment 223577 [details] [review]
TelepathyClient: don't emit an error if an unknown message is acknowledged

pending-messages-removed is emitted for sent messages too, but we don't
include those in the _pendingMessages list. Avoid useless spew in the session
logs in that case.
Comment 2 Giovanni Campagna 2012-09-05 21:17:49 UTC
Created attachment 223578 [details] [review]
TelepathyClient: ignore invalid message id errors

Those errors can happen if the pending queue message is not drained fast
enough and we attempt another ack_all_messages. They are harmless (they
just indicate the message is not pending), so ignore them.
Comment 3 Giovanni Campagna 2012-09-05 21:18:10 UTC
Created attachment 223579 [details] [review]
GrabHelper: always navigate focus when grabbing

Users of GrabHelper.grab() espect that the actor parameter (or one of its
children) will receive focus, irrespective of the previous focus location.
This fixes the key focus on the chat entry when expanding the notification.
Comment 4 Giovanni Campagna 2012-09-05 21:23:13 UTC
Created attachment 223580 [details] [review]
MessageTray: fix keybinding for fixed GrabHelper

With the new GrabHelper, grabbing focus ourselves is not necessary.
Comment 5 Giovanni Campagna 2012-09-05 21:29:33 UTC
(In reply to comment #4)
> Created an attachment (id=223580) [details] [review]
> MessageTray: fix keybinding for fixed GrabHelper
> 
> With the new GrabHelper, grabbing focus ourselves is not necessary.

Uhm, this is still broken after you exit the overview... Needs further investigation.
Comment 6 Giovanni Campagna 2012-09-05 22:04:56 UTC
Created attachment 223582 [details] [review]
GrabHelper: always navigate focus when grabbing

Users of GrabHelper.grab() espect that the actor parameter (or one of its
children) will receive focus, irrespective of the previous focus location.
This fixes the key focus on the chat entry when expanding the notification.

This one is even better, and keeps the right focus when entering the overview.
Comment 7 Jasper St. Pierre (not reading bugmail) 2012-09-06 02:04:10 UTC
Review of attachment 223582 [details] [review]:

Commit message still says "always". Also, "espect".

And I remember having issues with this before, but whatever. If it works, it works.
Comment 8 Jasper St. Pierre (not reading bugmail) 2012-09-06 02:04:53 UTC
Review of attachment 223580 [details] [review]:

Did you obsolete this one by mistake?
Comment 9 Jasper St. Pierre (not reading bugmail) 2012-09-06 02:06:00 UTC
Review of attachment 223577 [details] [review]:

We really should include sent messages in the _pendingMessages list.
Comment 10 Jasper St. Pierre (not reading bugmail) 2012-09-06 02:06:30 UTC
Review of attachment 223578 [details] [review]:

When will the "pending queue message" not be drained fast enough?
Comment 11 Giovanni Campagna 2012-09-06 13:17:01 UTC
(In reply to comment #9)
> Review of attachment 223577 [details] [review]:
> 
> We really should include sent messages in the _pendingMessages list.

That means having the source counter include the number of pending sent messages, which is wrong.

(In reply to comment #10)
> Review of attachment 223578 [details] [review]:
> 
> When will the "pending queue message" not be drained fast enough?

I'm not sure, I think it's when the previous acking is currently in flight, the pending-message-removed was not emitted and you open the notification, thus acking all messages again.
Comment 12 Giovanni Campagna 2012-09-06 13:17:42 UTC
(In reply to comment #8)
> Review of attachment 223580 [details] [review]:
> 
> Did you obsolete this one by mistake?

No, it was meant for the previous iteration of the GrabHelper patch. With the new one, it's wrong.
Comment 13 Giovanni Campagna 2012-09-06 13:20:53 UTC
Comment on attachment 223582 [details] [review]
GrabHelper: always navigate focus when grabbing

Attachment 223582 [details] pushed as 5a259dd - GrabHelper: always navigate focus when grabbing
Comment 14 Giovanni Campagna 2012-09-13 21:19:04 UTC
Update on this one? At least patch 223577 is safe, and I don't want to wait after hard code freeze for it.
Comment 15 Jasper St. Pierre (not reading bugmail) 2012-09-13 21:21:21 UTC
(In reply to comment #14)
> Update on this one? At least patch 223577 [details] is safe, and I don't want to wait
> after hard code freeze for it.

I really don't think it's safe. We shouldn't be ignoring errors like this. I'd prefer it if we tracked sent messages mid-flight for various reasons.
Comment 16 Giovanni Campagna 2012-09-13 21:24:00 UTC
The various reasons being?

Note that if you really want all pending messages in the telepathy sense, rather than all message the user hasn't seen yet, you can use textChannel.get_pending_messages()
Comment 17 Jasper St. Pierre (not reading bugmail) 2012-09-13 21:39:03 UTC
Review of attachment 223577 [details] [review]:

Whoops, I completely misread the Telepathy code last time. This is fine.
Comment 18 Giovanni Campagna 2012-09-13 21:49:29 UTC
Comment on attachment 223577 [details] [review]
TelepathyClient: don't emit an error if an unknown message is acknowledged

Attachment 223577 [details] pushed as 488820d - TelepathyClient: don't emit an error if an unknown message is acknowledged
Comment 19 Giovanni Campagna 2012-10-28 17:55:46 UTC
And what about the other one?
It is really annoying to have the logs spammed with dozens of
JS ERROR: !!!   Exception was: TelepathyGLib.Error: invalid message id 68
    JS ERROR: !!!     message = '"invalid message id 68"'
    JS ERROR: !!!     fileName = '"/opt/gnome/share/gnome-shell/js/ui/components/telepathyClient.js"'
    JS ERROR: !!!     lineNumber = '748'
    JS ERROR: !!!     stack = '"0 anonymous("result" = [object GObject_Object], "src" = [object GObject_Object])@/opt/gnome/share/gnome-shell/js/ui/components/telepathyClient.js:748
Comment 20 Giovanni Campagna 2012-10-28 18:11:56 UTC
Btw, my new theory is that the shell is acking messages while acting as a Telepathy Observer, which conflicts with the acking done by empathy.
I am now testing it, and I'll post a patch if it works.
Comment 21 Giovanni Campagna 2012-10-29 17:08:20 UTC
Nope, I'm still getting the errors, but the shell is the handler for the channel.
Comment 22 Giovanni Campagna 2012-11-26 21:33:24 UTC
Created attachment 229948 [details] [review]
Telepathy: ignore errors from ack_all_pending_messages()

Invalid ID errors from that function are normal, because the set
of IDs to acknowledge may not match the set in the connection manager
due to race conditions.
This is also what empathy does.
Comment 23 Giovanni Campagna 2012-11-26 21:40:04 UTC
Created attachment 229949 [details] [review]
Telepathy: ignore errors from ack_all_pending_messages()

Invalid ID errors from that function are normal, because the set
of IDs to acknowledge may not match the set in the connection manager
due to race conditions.
This is also what empathy does.

Oops...
Comment 24 Guillaume Desmottes 2012-11-28 14:29:21 UTC
Review of attachment 229949 [details] [review]:

Looks good to me.
Comment 25 Giovanni Campagna 2012-11-28 16:47:39 UTC
Attachment 229949 [details] pushed as d517c13 - Telepathy: ignore errors from ack_all_pending_messages()