Merge lp://qastaging/~sergiusens/account-polld/twitter_avatar into lp://qastaging/~phablet-team/account-polld/trunk

Proposed by Sergio Schvezov
Status: Merged
Approved by: Sergio Schvezov
Approved revision: 25
Merged at revision: 24
Proposed branch: lp://qastaging/~sergiusens/account-polld/twitter_avatar
Merge into: lp://qastaging/~phablet-team/account-polld/trunk
Prerequisite: lp://qastaging/~sergiusens/account-polld/google_credentials
Diff against target: 135 lines (+70/-3)
2 files modified
plugins/plugins.go (+56/-0)
plugins/twitter/twitter.go (+14/-3)
To merge this branch: bzr merge lp://qastaging/~sergiusens/account-polld/twitter_avatar
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Roberto Alsina (community) Approve
Manuel de la Peña Pending
Review via email: mp+228405@code.qastaging.launchpad.net

Commit message

If the twitter user's avatar is available use it in the notification card's icon

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
25. By Sergio Schvezov

Download into cache instead and make DownloadAvatar worth it's name.

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

Other than the inline comment which is just a doubt, +1

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

On sábado 26 de julio de 2014 18h'17:55 ART, Roberto Alsina wrote:
> Review: Approve
>
> Other than the inline comment which is just a doubt, +1
>
> Diff comments:
>
>> === modified file 'plugins/plugins.go'
>> --- plugins/plugins.go 2014-07-25 20:09:20 +0000
>> +++ plugins/plugins.go 2014-07-26 21:03:48 +0000
>> @@ -19,10 +19,20 @@
>>
>> import (
> ...
>
> I keep getting confused as to whether to return err, result or
> result, err in go.
> If we want to check the error, it makes sense to return error
> first so it's harder to ignore.

By convention errors are the last return value.
I can't ignore it either unless I ignore everything or ignore it explicitly
as seen here:
http://play.golang.org/p/6kCrwVCzEt

>
>> + filePart := filepath.Join(cmdName, "avatars", pluginName,
>> path.Base(url))
>> + if file, err := xdg.Cache.Find(filePart); err == nil {
>> + return file, nil
>> + }
>> +
> ...
>
>

Revision history for this message
James Henstridge (jamesh) wrote :

Is it possible to pass the HTTP URL as part of the notification rather than downloading the image explicitly? There is already efforts to add a disk cache for downloaded images to the shell, so do we need a separate one here?

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

On lunes 28 de julio de 2014 04h'33:13 ART, James Henstridge wrote:
> Is it possible to pass the HTTP URL as part of the notification
> rather than downloading the image explicitly? There is already
> efforts to add a disk cache for downloaded images to the shell,
> so do we need a separate one here?

This will need to be circled back to the push people, AFAIK, that is not
yet supported.

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

On lunes 28 de julio de 2014 09h'03:21 ART, Sergio Schvezov wrote:
> On lunes 28 de julio de 2014 04h'33:13 ART, James Henstridge wrote:
>> Is it possible to pass the HTTP URL as part of the notification
>> rather than downloading the image explicitly? There is already
>> efforts to add a disk cache for downloaded images to the shell,
>> so do we need a separate one here?
>
> This will need to be circled back to the push people, AFAIK, that is not
> yet supported.

Just tried (with gdbus), it does't work.

Revision history for this message
James Henstridge (jamesh) wrote :

My main concerns with this are:

1. there is no cache eviction, so it will continue to grow unchecked. There is nothing in the push notifications model to tell account-polld when the image isn't needed any more either, so it's not clear how this can be handled reliably.

2. there is no cache validation, so if new avatar images are served from the same URL we will never notice that change.

And if using URIs for icons doesn't work, how exactly will real push notifications provide icons once we have them?

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

On martes 29 de julio de 2014 00h'47:50 ART, James Henstridge wrote:
> My main concerns with this are:
>
> 1. there is no cache eviction, so it will continue to grow
> unchecked. There is nothing in the push notifications model to
> tell account-polld when the image isn't needed any more either,
> so it's not clear how this can be handled reliably.
>
> 2. there is no cache validation, so if new avatar images are
> served from the same URL we will never notice that change.

I thought of adding this as a next step.

> And if using URIs for icons doesn't work, how exactly will real
> push notifications provide icons once we have them?

Chipaca told me that the push-helper would do that.

Revision history for this message
James Henstridge (jamesh) wrote :

That still doesn't answer the question of how account-polld will know when a particular image is no longer needed. The post office never tells us when a particular notification has been dismissed. The more I think about it, the more this feels like the wrong way to handle the problem.

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

On martes 29 de julio de 2014 07h'28:43 ART, James Henstridge wrote:
> That still doesn't answer the question of how account-polld
> will know when a particular image is no longer needed. The post
> office never tells us when a particular notification has been
> dismissed. The more I think about it, the more this feels like
> the wrong way to handle the problem.

Feel free to rewrite it. I just downloaded persistently to keep it on
across reboots since my gripe with the unity click scope making me spend
more money than I wanted to.

Does it matter for account-polld to know the instant it doesn't need an
image anymore? I'd believe mentions are from the same regular people most
of the time.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches