Undo (Ctrl+Z) does not restore deleted emails when deletion is done via Delete key in versions >= 1.17.2

Description

Since Mailspring version 1.17.2, undoing an email deletion using Ctrl+Z no longer works when the email is deleted using the Delete (DEL) key.
This worked correctly in version 1.17.1. The issue is present in all versions starting from 1.17.2.
The problem occurs on multiple accounts, including Microsoft Outlook and a standard IMAP account.

To Reproduce…

Steps to reproduce the behavior:

  1. Open Mailspring

  2. Select an email in the inbox

  3. Press the Delete (DEL) key to delete the email

  4. Press Ctrl+Z to undo the deletion

Expected Behavior

The deleted email should be restored to its original folder (Inbox or previous folder), as it was in version 1.17.1.

Screenshots

Nothing happens when pressing Ctrl+Z.
The email remains in the Deleted folder.
No error message or notification is shown.

Setup

OS and Version:

  • Windows 10 22h2 19045.6809
    Installation Method:
  • EXE installer downloaded from the official GitHub releases
    Mailspring Version:
  • Affected: 1.17.2 and later
  • Last working version: 1.17.1
    Email Account Types:
  • Microsoft Outlook
  • Standard IMAP account
    (The issue occurs on all tested accounts)
    Keyboard Layout:
  • AZERTY

Additional Context

The issue is 100% reproducible.
No relevant errors were found in the logs.
The problem appears to be a regression introduced in version 1.17.2.

Thank you so much for identifying the version to revert to! I just reinstalled 1.17.1 and will stay on it until this issue is fixed.