nextcloud / nextcloud/mail

Reduce network usage composing mails with large inline attachments

Open
#13,536 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop enhancement feature:composer feature:drafts performance 🚀
Dominant language
JavaScript
Stars
1k
Forks
348
Avg merge
12h 28m
Merged PRs (30d)
91

Description

Is your feature request related to a problem? Please describe.

When pasting an image in to a mail we store it in the <img> src attribute as a data URL.

`<img src="data:image/png;base64,iVBO...`
  • Given:
    • Composing HTML mail with large inline attachment
  • When
    • Editing the mail
  • Then
    • A draft is saved continuously (with some denounce)
      - The send draft text is large because data URL is part of the HTML
Describe the solution you'd like

When saving the draft for the first time, upload the inline attachments to the server and replace references to data URLs to the attachment URLs.
And from then on only use the attachment ULRs in the HTML source.

Describe alternatives you've considered

Keeping as is if handling life cycle of separately uploaded inline attachments is not to complicated.
But I assume we already have similar handling for regular attachments there this would only reuse the mechanism we already have in place.

Additional context

Relates with #13535 and might be worth tackling together (or at least with each other in mind), because the implementations would be touch the same code.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the draft-save flow for the mail composer and locate the existing lifecycle handling for regular attachments. Review issue #13535 alongside this issue, then verify that the first draft save uploads inline data URLs and subsequent saves use attachment URLs without leaving orphaned uploads.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
full-stack
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.