Multiple drafts created due to Gmail (webapp) autosave feature

Description

To Reproduce…

Steps to reproduce the behavior:

  1. Keep Mailspring open
  2. Goto webapp of connected gmail account and start creating an email
  3. Write normally and give enough time to let Gmail Autosave
  4. Check multiple partial drafts in Mailspring

Expected Behavior

Single latest draft in mailspring

Screenshots

Setup

  • OS and Version: Fedora Linux 34
    • Installation Method: RPM
  • Mailspring Version: 1.9.2-6e14dad1

Additional Context

Same issue:

@bengotow 's reply

I don’t think IMAP delete is failing since cosing and reopening mailspring updates and performs delete properly.

One possible fix I can think of is to trigger update upon encountering multiple emails with same senders and subject, or just identical subject. Because after mailspring says checking for mail... the multiple draft issue seems to sort itself out. If the same thing is triggered more often or especially upon encountering same subjectline, this could probably be solved.