Description
Steps to reproduce
Move an email:
{ "using": [ "urn:ietf:params:jmap:core", "urn:ietf:params:jmap:mail"], "methodCalls": [ ["Email/set", { "accountId": "$ACCOUNT_ID", "update": { "${messageId.serialize}":{ "mailboxIds": { "${mailboxId2.serialize()}": true } } } }, "c1"]] }
Then perform an /changes request:
{ "using": ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:mail"], "methodCalls": [[ "Email/changes", { "accountId": "$ACCOUNT_ID", "sinceState": "${oldState.getValue}" }, "c1"]] }
We expect the message to be reported as updated
The message is actually "destroyed"
Explanation
Upon moves to events are generated:
- added for the new mailbox
- expunged in the old one
When aggregating events together, only destroyed is returned.
The fix
Upon expunge, we need to check if the message can still be accessed by the user. If yes, we shall report it as "updated" and not destroyed.
This 'fix' generated slightly more asynchronous reads upon moves but is likely acceptable.