woj-tek commented on code in PR #2386:
URL: https://github.com/apache/james-project/pull/2386#discussion_r1725349088


##########
protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java:
##########
@@ -201,10 +201,12 @@ private Mono<Void> doFetch(SelectedMailbox selected, 
FetchRequest request, Respo
         List<MessageRange> ranges = new ArrayList<>();
 
         for (IdRange range : request.getIdSet()) {
-            MessageRange messageSet = messageRange(session.getSelected(), 
range, request.isUseUids())
-                .orElseThrow(() -> new 
MessageRangeException(range.getFormattedString() + " is an invalid range"));
-            if (messageSet != null) {
-                MessageRange normalizedMessageSet = 
normalizeMessageRange(selected, messageSet);
+            if (session.getSelected().getLastUid().isEmpty()) {
+                continue;
+            }

Review Comment:
   So basically:
   
   ```java
       private MessageRange msnRangeToMessageRange(SelectedMailbox selected, 
long lowVal, long highVal)
               throws MessageRangeException {
           // Take care of "*", "1:*" and "*:*" values by return the last 
message in
           // the mailbox. See IMAP-289
           if ((lowVal == Long.MAX_VALUE || lowVal == 1) && highVal == 
Long.MAX_VALUE) {
               return MessageRange.all();
           }
   
   ```
   
   ?
   
   (ran the MPT tests and it does work but not sure if that was your suggestion)



-- 
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]

Reply via email to