I did some more investigation. This applies only to the new GMail UI and old stuff works fine. It also only applies to "reply" and regular new message compose works fine.
User press "send" on a reply compose window and on "presending" event the extension does the following:
- Issues "composeView.cancel()"
- Issues an ajax call to obtain metadata
- On ajax completion, extension updates "body" and adds an attachment using composeView.attachFiles().
- On completion of composeView.attachFiles() promise the extension issues composeView.send();
The problem is happening on "composeView.attachFiles()". I see a red popup message "saving message error". After few seconds I see a new message "sending message" and finally "message sent". I don't understand why the attach failed and then succeeded.
3 unexpected behaviors
- why display an error message to the user if the upload of attachment is retried and is successful?
- why the inline reply compose window is not dismissed after the send completed?
- why no 'sent' event is dispatched on the composeView?
When I press "discard" then the UI disappears without any effect. As I mentioned before the message actually makes it fine along with attachment to the recipients.
This error wasn't there just last week so definitely a regression.
I retested the flow with a "popout" reply compose instead of inline. Same flow as above, I still see the attachment error message "saving message error" popping up but the compose window closed after the send. Again, no 'sent' event is dispatched.