chibenwa commented on code in PR #1477:
URL: https://github.com/apache/james-project/pull/1477#discussion_r1133047113
##########
server/protocols/jmap-draft/src/main/java/org/apache/james/jmap/event/PopulateEmailQueryViewListener.java:
##########
@@ -156,13 +157,22 @@ private Mono<Void> handleAdded(Added added) {
private Mono<Void> handleAdded(Added added, MessageMetaData
messageMetaData, MailboxSession session) {
MessageId messageId = messageMetaData.getMessageId();
+ MailboxId mailboxId = added.getMailboxId();
- return
Flux.from(messageIdManager.getMessagesReactive(ImmutableList.of(messageId),
FetchGroup.HEADERS, session))
- .next()
+ return checkMessageStillInOriginMailbox(messageId, session, mailboxId)
+ .filter(FunctionalUtils.identityPredicate())
+ .flatMap(stillInOriginMailbox ->
Flux.from(messageIdManager.getMessagesReactive(ImmutableList.of(messageId),
FetchGroup.HEADERS, session))
+ .next())
.filter(message -> !message.getFlags().contains(DELETED))
.flatMap(messageResult -> handleAdded(added.getMailboxId(),
messageResult));
}
Review Comment:
Please do this check only if
`added.getMailboxPath().getName().isEqualTo(OUTBOX)` to limit its cost....
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]