This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit dc560803d427b77d195a3a6a65c5043bc8f70f77
Author: Benoit TELLIER <btell...@linagora.com>
AuthorDate: Mon Feb 26 17:25:23 2024 +0100

    JAMES-4007 Remove subscription once data is all received
---
 .../org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git 
a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
 
b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
index 27628ad1f1..e157c0e8b2 100644
--- 
a/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
+++ 
b/server/protocols/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
@@ -227,12 +227,13 @@ public class ImapRequestFrameDecoder extends 
ByteToMessageDecoder implements Net
                         ImapRequestLineReader reader = new 
NettyStreamImapRequestLineReader(ctx.channel(), fileChunkConsumer.getFile(), 
RETRY);
 
                         try {
+                            // Remove ongoing subscription: now on lifecycle 
of the message will be managed by ImapChannelUpstreamHandler.
+                            // Not doing this causes IDLEd IMAP connections to 
clear IMAP append literal while they are processed.
+                            attachment.remove(SUBSCRIPTION);
                             parseImapMessage(ctx, null, attachment, 
Pair.of(reader, size), readerIndex)
                                 .ifPresent(message -> {
+
                                     ctx.fireChannelRead(message);
-                                    // Remove ongoing subscription: now on 
lifecycle of the message will be managed by ImapChannelUpstreamHandler.
-                                    // Not doing this causes IDLEd IMAP 
connections to clear IMAP append literal while they are processed.
-                                    attachment.remove(SUBSCRIPTION);
                                 });
                         } catch (DecodingException e) {
                             ctx.fireExceptionCaught(e);


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org

Reply via email to