New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch avatars from different sources #469

Merged
merged 18 commits into from Nov 16, 2017

Conversation

@jakobsack
Member

jakobsack commented Aug 25, 2017

This implements parts of #463 and #236
When you open mail/avatars?email=test@example.com you get a JSON response
{ url: $url, source: $source }.
If no image has been found $url is null.

@jakobsack jakobsack requested a review from Gomez Aug 25, 2017

@ChristophWurst ChristophWurst added this to the 0.8 milestone Aug 28, 2017

Show outdated Hide outdated js/models/messagecollection.js Outdated
Show outdated Hide outdated js/models/messagecollection.js Outdated
Show outdated Hide outdated js/models/messagecollection.js Outdated
Show outdated Hide outdated js/models/messagecollection.js Outdated
Show outdated Hide outdated lib/Controller/AvatarsController.php Outdated
Show outdated Hide outdated lib/Controller/AvatarsController.php Outdated
Show outdated Hide outdated lib/Service/AvatarService.php Outdated
Show outdated Hide outdated lib/Service/AvatarService.php Outdated
Show outdated Hide outdated lib/Service/AvatarService.php Outdated

@jakobsack jakobsack changed the title from Add new controller for avatar fetching to [WIP] Add new controller for avatar fetching Aug 28, 2017

@jakobsack

This comment has been minimized.

Show comment
Hide comment
@jakobsack

jakobsack Aug 28, 2017

Member

The avatars are now cached in data/$user/mail/avatars. The images are loaded right from the beginning if possible.

Member

jakobsack commented Aug 28, 2017

The avatars are now cached in data/$user/mail/avatars. The images are loaded right from the beginning if possible.

@ChristophWurst

This comment has been minimized.

Show comment
Hide comment
@ChristophWurst

ChristophWurst Sep 5, 2017

Member

@jakobsack what's your current status? The title and the tags are a bit contradictory :-P

Btw, there seem to be conflicts with the composer deps.

Member

ChristophWurst commented Sep 5, 2017

@jakobsack what's your current status? The title and the tags are a bit contradictory :-P

Btw, there seem to be conflicts with the composer deps.

@jakobsack jakobsack added 2. developing and removed 3. to review labels Sep 5, 2017

@jakobsack

This comment has been minimized.

Show comment
Hide comment
@jakobsack

jakobsack Sep 5, 2017

Member

Sorry, I bricked my laptop last Friday. I'll try to add the last adjustments during this week.

Member

jakobsack commented Sep 5, 2017

Sorry, I bricked my laptop last Friday. I'll try to add the last adjustments during this week.

@ChristophWurst

This comment has been minimized.

Show comment
Hide comment
@ChristophWurst

ChristophWurst Sep 5, 2017

Member

Sorry, I bricked my laptop last Friday. I'll try to add the last adjustments during this week.

Take your time :)

Member

ChristophWurst commented Sep 5, 2017

Sorry, I bricked my laptop last Friday. I'll try to add the last adjustments during this week.

Take your time :)

@jancborchardt

This comment has been minimized.

Show comment
Hide comment
@jancborchardt

jancborchardt Oct 11, 2017

Member

@jakobsack any update here or any way we can help? :)

Member

jancborchardt commented Oct 11, 2017

@jakobsack any update here or any way we can help? :)

@jakobsack

This comment has been minimized.

Show comment
Hide comment
@jakobsack

jakobsack Oct 19, 2017

Member

@ChristophWurst @Gomez Can you test the latest changes please? And tell me why composer won't work on travis? On my machine everything works fine :-/

Member

jakobsack commented Oct 19, 2017

@ChristophWurst @Gomez Can you test the latest changes please? And tell me why composer won't work on travis? On my machine everything works fine :-/

@jakobsack

This comment has been minimized.

Show comment
Hide comment
@jakobsack

jakobsack Oct 22, 2017

Member

I don't know why the MySQL version fails but it seems not to be related to my changes.

Member

jakobsack commented Oct 22, 2017

I don't know why the MySQL version fails but it seems not to be related to my changes.

@ChristophWurst ChristophWurst self-assigned this Oct 23, 2017

@ChristophWurst ChristophWurst added this to SELECTED in Christoph's Tasks Oct 23, 2017

Refers to outdated commits

@ChristophWurst ChristophWurst requested a review from skjnldsv Nov 13, 2017

@ChristophWurst

This comment has been minimized.

Show comment
Hide comment
@ChristophWurst

ChristophWurst Nov 13, 2017

Member

Still, some ideas for that are: have a avatar service on the client-side that aggregates avatar loading and de-duplicates the requests. This is especially useful where you have many messages from the same sender and thus the current logic would send multiple requests.

And we could add a background job that pre-poluates the cache 😉

Member

ChristophWurst commented Nov 13, 2017

Still, some ideas for that are: have a avatar service on the client-side that aggregates avatar loading and de-duplicates the requests. This is especially useful where you have many messages from the same sender and thus the current logic would send multiple requests.

And we could add a background job that pre-poluates the cache 😉

@jancborchardt

This comment has been minimized.

Show comment
Hide comment
@jancborchardt

jancborchardt Nov 14, 2017

Member

@ChristophWurst will start reviewing now, meanwhile Fyi there are conflicting files. (And the package-lock.json should be in .gitignore maybe?)

Member

jancborchardt commented Nov 14, 2017

@ChristophWurst will start reviewing now, meanwhile Fyi there are conflicting files. (And the package-lock.json should be in .gitignore maybe?)

@ChristophWurst

This comment has been minimized.

Show comment
Hide comment
@ChristophWurst

ChristophWurst Nov 14, 2017

Member

meanwhile Fyi there are conflicting files.

Thanks. Will take care of it.

And the package-lock.json should be in .gitignore maybe

Nope, that makes sure everyone installs the exact same version of a dependency and additionally also speeds up the installation of npm packages: https://docs.npmjs.com/files/package-lock.json

Member

ChristophWurst commented Nov 14, 2017

meanwhile Fyi there are conflicting files.

Thanks. Will take care of it.

And the package-lock.json should be in .gitignore maybe

Nope, that makes sure everyone installs the exact same version of a dependency and additionally also speeds up the installation of npm packages: https://docs.npmjs.com/files/package-lock.json

ChristophWurst added some commits Nov 14, 2017

fixup! Cleanup, refactor and test new AvatarService
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
@jancborchardt

This comment has been minimized.

Show comment
Hide comment
@jancborchardt

jancborchardt Nov 14, 2017

Member

So I did make install-composer-deps, but then on the next it fails like this:

jan@Rechenknecht:~/nextcloud/apps/mail$ make optimize-js 
npm install --production
npm WARN grunt-jscs@1.8.0 requires a peer of grunt@~0.4.2 but none is installed. You must install peer dependencies yourself.

up to date in 2.901s
./node_modules/webpack/bin/webpack.js --config js/webpack.prod.config.js
module.js:515
    throw err;
    ^

Error: Cannot find module 'json-stable-stringify'
    at Function.Module._resolveFilename (module.js:513:15)
    at Function.Module._load (module.js:463:25)
    at Module.require (module.js:556:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/jan/nextcloud/apps/mail/node_modules/ajv/lib/compile/util.js:19:20)
    at Module._compile (module.js:612:30)
    at Object.Module._extensions..js (module.js:623:10)
    at Module.load (module.js:531:32)
    at tryModuleLoad (module.js:494:12)
    at Function.Module._load (module.js:486:3)
Makefile:39: recipe for target 'optimize-js' failed
make: *** [optimize-js] Error 1
Member

jancborchardt commented Nov 14, 2017

So I did make install-composer-deps, but then on the next it fails like this:

jan@Rechenknecht:~/nextcloud/apps/mail$ make optimize-js 
npm install --production
npm WARN grunt-jscs@1.8.0 requires a peer of grunt@~0.4.2 but none is installed. You must install peer dependencies yourself.

up to date in 2.901s
./node_modules/webpack/bin/webpack.js --config js/webpack.prod.config.js
module.js:515
    throw err;
    ^

Error: Cannot find module 'json-stable-stringify'
    at Function.Module._resolveFilename (module.js:513:15)
    at Function.Module._load (module.js:463:25)
    at Module.require (module.js:556:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/jan/nextcloud/apps/mail/node_modules/ajv/lib/compile/util.js:19:20)
    at Module._compile (module.js:612:30)
    at Object.Module._extensions..js (module.js:623:10)
    at Module.load (module.js:531:32)
    at tryModuleLoad (module.js:494:12)
    at Function.Module._load (module.js:486:3)
Makefile:39: recipe for target 'optimize-js' failed
make: *** [optimize-js] Error 1
@ChristophWurst

This comment has been minimized.

Show comment
Hide comment
@ChristophWurst

ChristophWurst Nov 15, 2017

Member

but then on the next it fails like this:

See #615

Member

ChristophWurst commented Nov 15, 2017

but then on the next it fails like this:

See #615

Christoph's Tasks automation moved this from TO REVIEW (max 4 PRs) to DONE Nov 16, 2017

@jancborchardt jancborchardt reopened this Nov 16, 2017

Christoph's Tasks automation moved this from DONE to IN PROGRESS (max 3 PRs) Nov 16, 2017

@jancborchardt

This comment has been minimized.

Show comment
Hide comment
@jancborchardt

jancborchardt Nov 16, 2017

Member

Doesn’t seem to work for me, even with the fixed optimize-js:
screenshot from 2017-11-16 16-40-03

Member

jancborchardt commented Nov 16, 2017

Doesn’t seem to work for me, even with the fixed optimize-js:
screenshot from 2017-11-16 16-40-03

@jancborchardt

This comment has been minimized.

Show comment
Hide comment
@jancborchardt

jancborchardt Nov 16, 2017

Member

After switching folders now it seemed to load. :D

Member

jancborchardt commented Nov 16, 2017

After switching folders now it seemed to load. :D

@jancborchardt

Weeeeeeee! Greaaat work!

@ChristophWurst ChristophWurst merged commit b11cdf6 into master Nov 16, 2017

3 checks passed

Scrutinizer 9 new issues, 55 updated code elements
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 92.593%
Details

Christoph's Tasks automation moved this from IN PROGRESS (max 3 PRs) to DONE Nov 16, 2017

@ChristophWurst ChristophWurst deleted the avatars branch Nov 16, 2017

@ChristophWurst

This comment has been minimized.

Show comment
Hide comment
@ChristophWurst

ChristophWurst Nov 16, 2017

Member

Whoops now I was too happy about the approved review that I forgot to squash the commits 🙈

Member

ChristophWurst commented Nov 16, 2017

Whoops now I was too happy about the approved review that I forgot to squash the commits 🙈

@ChristophWurst

This comment has been minimized.

Show comment
Hide comment
@ChristophWurst

ChristophWurst Nov 16, 2017

Member

@jakobsack don't forget to claim your bounties for #463 and #236 😉

Member

ChristophWurst commented Nov 16, 2017

@jakobsack don't forget to claim your bounties for #463 and #236 😉

@Titan-C

This comment has been minimized.

Show comment
Hide comment
@Titan-C

Titan-C Mar 9, 2018

How is this configuration activated? I have nextcloud 13 & contacs 2.1.2. I load my contacts but avatars are not fetched.

Titan-C commented Mar 9, 2018

How is this configuration activated? I have nextcloud 13 & contacs 2.1.2. I load my contacts but avatars are not fetched.

@ChristophWurst

This comment has been minimized.

Show comment
Hide comment
@ChristophWurst

ChristophWurst Mar 9, 2018

Member

Please file a ticket for this bug. Thanks you.

Member

ChristophWurst commented Mar 9, 2018

Please file a ticket for this bug. Thanks you.

@nextcloud nextcloud locked and limited conversation to collaborators Mar 9, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.