Page MenuHomePhabricator

Save mail attachments in Files, not on the actual objects
ClosedPublic

Authored by epriestley on Feb 1 2018, 8:04 PM.
Tags
None
Referenced Files
F13285375: D18986.id45537.diff
Mon, Jun 3, 7:39 PM
F13283209: D18986.diff
Sun, Jun 2, 1:16 PM
F13271371: D18986.diff
Wed, May 29, 9:41 PM
F13269188: D18986.diff
Wed, May 29, 5:55 AM
F13255268: D18986.diff
Sat, May 25, 4:34 AM
F13234026: D18986.diff
Tue, May 21, 2:43 AM
F13219161: D18986.id45531.diff
Sat, May 18, 3:53 PM
F13213889: D18986.diff
Fri, May 17, 8:11 AM
Subscribers
None

Details

Summary

Depends on D18985. Ref T13053. See PHI125. Currently, mail attachments are just encoded onto the actual objects in the MetaMTAMail table.

This fails if attachments can't be encoded in JSON -- e.g., they aren't UTF8. This happens most often when revisions or commits attach patches to mail and those patches contain source code changes for files that are not encoded in UTF8.

Instead, save attachments in (and load attachments from) Files.

Test Plan

Enabled patches for mail, created a revision, saw it attach a patch. Viewed mail in web UI, saw link to download patch. Followed link, saw sensible file. Checked database, saw a filePHID. Destroyed mail with bin/remove destroy, saw attached files also destroyed.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable