Reduce network usage composing mails with large inline attachments
Nobody has claimed this yet.
- 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
- A draft is saved continuously (with some denounce)
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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