Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
BUG: Inline images corrupted when editing previously scheduled message
As per https://bugzilla.mozilla.org/show_bug.cgi?id=1389242, there is currently a bug in Thunderbird: when editing a previously saved draft, Thunderbird tells add-ons that the draft has finished being loaded into the editor when in fact embedded images haven't finished loading yet. Since Send Later saves previously scheduled drafts immediately when they start being edited to prevent them from being delivered on schedule while they are being edited, this is problematic... If there are any embedded images in the draft, they haven't been loaded yet, so the saved draft gets corrupted. This commit sets up a watcher in the background which keeps checking the body of the message for up to two seconds (which should be more than enough -- it usually doesn't take more than 10 to 20 milliseconds) for the embedded images to be finished loading, and _then_ saves the draft. This is a gross workaround, but I think it's the best we can do for the time being.
- Loading branch information