Bug 30640

Summary: The second Google Mail notification may take up to 60 seconds to occur
Product: Telepathy Reporter: Nicolas Dufresne <nicolas>
Component: gabbleAssignee: Nicolas Dufresne <nicolas>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium Keywords: patch
Version: 0.10   
Hardware: Other   
OS: All   
URL: http://git.collabora.co.uk/?p=user/nicolas/telepathy-gabble.git;a=shortlog;h=refs/heads/speedup-mail-notification
Whiteboard: review+ with trivial changes
i915 platform: i915 features:
Attachments: Mail status polling to workaround server lazyness

Description Nicolas Dufresne 2010-10-05 16:31:14 UTC
Created attachment 39198 [details] [review]
Mail status polling to workaround server lazyness

As discussed in http://bugs.meego.com/show_bug.cgi?id=3879, it was found that Google Server spaces <new-mail> event of a fixed period of 60 seconds. This leads to very bad user experience in Meego MyZone.

While this is a server design issue, we can workaround this issue by polling the mail status during this 60 seconds period. See attached patch for propose solution. With a fixed delay of 5 seconds, the overhead of this solution is 12 mail updates spread on a period of 60 seconds, after what the polling can stop since new-mail are re-enabled on server side. Polling is indeed disabled if nobody is subscribed to mail notification interface.
Comment 1 Nicolas Dufresne 2010-10-12 05:24:25 UTC
Please review the attached patch, this is considered a blocker for Meego 1.1.
Comment 2 Simon McVittie 2010-10-12 08:42:07 UTC
Splinter seems to be broken, so no nice diff output, sorry...

If this is how the server works, then your hack seems to be the least bad possible, although I'm not particularly happy about it. Hopefully Google will fix their server...

Some English fixes:

s/lazyness/laziness/, s/periode/period/, s/every POLL_DELAY second/every POLL_DELAY seconds/

+      DEBUG ("Stop polling mail after %i seconds", priv->poll_count * POLL_DELAY);

"stop" is the wrong tense: perhaps "%i seconds since <new-mail>, stopping polling"?

+      DEBUG ("Polling mail since %i seconds", priv->poll_count * POLL_DELAY);

That's not how "since" works in English: perhaps "%i seconds since <new-mail>, still polling"?

+          DEBUG ("Start polling mail for next %i seconds", POLL_DURATION);

"Polling mail for next %i seconds" or "Starting to poll mail for next %i seconds"
Comment 3 Nicolas Dufresne 2010-10-13 09:55:53 UTC
Fixed remaining, and pushed upstream.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.