Skip to content
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

[Epic] Attachment thumbnails #528

Open
chibenwa opened this issue Nov 14, 2022 · 4 comments
Open

[Epic] Attachment thumbnails #528

chibenwa opened this issue Nov 14, 2022 · 4 comments
Labels

Comments

@chibenwa
Copy link
Member

chibenwa commented Nov 14, 2022

What ?

As a user, I want to preview my attachments from within the application, before even starting to download it.

Example of thumbnails on GMail:

Screenshot from 2022-11-14 09-10-04.png

Acceptance criteria

  • Reasonable runtime costs: thumbnails should not account for more of 10% of the runtime costs
  • Reasonable storage costs: thumbnails should not account for more of 10% of the storage costs
  • Displaying a thumbnail should take no more than 500ms on average and no more than 2s in p99.

How?

Design a JMAP extension, that, given an attachment id, would return the blob Ids of its thumbnails.

The thumbnail computation could be done through a mailbox listener calling something like https://github.com/apache/sling-org-apache-sling-thumbnails to extract the thumbnails and store them.

Or more: https://github.com/linagora/linshare-thumbnail-server#readme

Special considerations that needs to be taken into account: RFC-8621 implementation is currently not backed by attachments but directly by the mime body parts. Should we do something smarter? Or thumbnails could be computed from the mime parts directly?

Alternatives:

  • Computing thumbnails on the fly and caching them in Redis?

Dod

  • Given an email with an attachment added, it's thumbnail is added and exposed
  • When the attachment is deleted, its thumbnail is deleted to
  • Given a delegation to somebody else mailbox, I can access the thumbnail
  • Without the rights, I can't access the thumbnail
  • Benchmarks off the thumbnail generation process, of the thumbnail access process.

Related links

@chibenwa
Copy link
Member Author

chibenwa commented Mar 9, 2023

  • Experiment with LinShare thumbnail server (curl exemple)

https://github.com/linagora/linshare-thumbnail-server/blob/master/README.md

https://github.com/linagora/linshare-docker/blob/master/docker-compose.yml#L87

https://github.com/linagora/linshare-thumbnail-engine

https://github.com/linagora/linshare-thumbnail-server/blob/master/src/main/java/org/linagora/linshare/thumbnail/server/ThumbnailResource.java

Test: https://github.com/linagora/linshare-thumbnail-server/blob/55061442ab37aeaddc233471a35e3142e24b0c89/src/test/java/linshare/linthumbnail/dropwizard/DropwizardRestTest.java#L86

  • Design a JMAP API for getting thumbnails

-> capability for it
-> Proposal : GET download/{accountId}/thumbnail/{blobId}?size=small|medium|large

404 if no humbnail available

@chibenwa chibenwa changed the title Attachment thumbnails [Epic] Attachment thumbnails Mar 9, 2023
@chibenwa
Copy link
Member Author

chibenwa commented Mar 9, 2023

@Arsnael
Copy link
Member

Arsnael commented Mar 10, 2023

Btw despite the fact it's company soft, should we be worried that it seems it has not really been maintained for easily 2 years, when you look at the dates of last commits?

@chibenwa
Copy link
Member Author

IMO no need to worry as the last contributor is still employed here but good question ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants