Gnus development mailing list
 help / color / mirror / Atom feed
* nnimap: error/warning while trying to quit group
@ 2002-09-16 13:54 Nevin Kapur
  2002-09-16 15:39 ` [PATCH] " Nevin Kapur
  0 siblings, 1 reply; 5+ messages in thread
From: Nevin Kapur @ 2002-09-16 13:54 UTC (permalink / raw)


Since updating this morning (last update was last Monday) I get the
following error when quitting a group:

(5) (error/warning) Error in process filter: (error Internal error,
    tag 598 status BAD code nil text Bogus criteria list in UID
    SEARCH)

Setting imap-log yields the following insight:

586 UID SEARCH UID 1460:1784,1786:2366,2368:2440,2442:2520,2522:2550 NOT SINCE 16-Aug-2002
* SEARCH
586 OK UID SEARCH completed
587 UID SEARCH UID 
587 BAD Bogus criteria list in UID SEARCH
588 EXPUNGE
588 OK No messages deleted, so no update needed

Any idea what's going on?

-Nevin





^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] Re: nnimap: error/warning while trying to quit group
  2002-09-16 13:54 nnimap: error/warning while trying to quit group Nevin Kapur
@ 2002-09-16 15:39 ` Nevin Kapur
  2002-09-17 10:26   ` Simon Josefsson
  0 siblings, 1 reply; 5+ messages in thread
From: Nevin Kapur @ 2002-09-16 15:39 UTC (permalink / raw)


Nevin Kapur <nevin@jhu.edu> writes:

> Since updating this morning (last update was last Monday) I get the
> following error when quitting a group:
>
> (5) (error/warning) Error in process filter: (error Internal error,
>     tag 598 status BAD code nil text Bogus criteria list in UID
>     SEARCH)

The following patch fixes this for me.  I'm not sure if this is the
"right" thing to do.  Would someone review it and apply it if
appropriate?

2002-09-16  Nevin Kapur <nevin@jhu.edu>

	* nnimap.el (nnimap-request-expire-articles): Don't call
	nnimap-expiry-target unless needed.

Index: nnimap.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/nnimap.el,v
retrieving revision 6.39
diff -u -r6.39 nnimap.el
--- nnimap.el	2002/09/11 08:13:03	6.39
+++ nnimap.el	2002/09/16 16:14:52
@@ -1337,7 +1337,8 @@
 					 (nnimap-date-days-ago days))))
 		       (imap-fetch-data-hook
 			'(nnimap-request-expire-articles-progress)))
-		   (nnimap-expiry-target oldarts group server)
+		   (when oldarts
+		     (nnimap-expiry-target oldarts group server))
 		   (and oldarts
 			(imap-message-flags-add
 			 (imap-range-to-message-set

-Nevin




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Re: nnimap: error/warning while trying to quit group
  2002-09-16 15:39 ` [PATCH] " Nevin Kapur
@ 2002-09-17 10:26   ` Simon Josefsson
  2002-09-17 20:31     ` Nevin Kapur
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Josefsson @ 2002-09-17 10:26 UTC (permalink / raw)


Nevin Kapur <nevin@jhu.edu> writes:

> The following patch fixes this for me.  I'm not sure if this is the
> "right" thing to do.  Would someone review it and apply it if
> appropriate?

It looks fine, thanks. A code cleanup seems to be in order though, can
you test this patch?  (On some unimportant groups, preferably.)

2002-09-17  Simon Josefsson  <jas@extundo.com>

	* nnimap.el (nnimap-expiry-target): Don't search for which
	articles exists here.
	(nnimap-request-expire-articles): Do it here instead.  Only expire
	when articles are found.  Suggested by Nevin Kapur
	<nevin@jhu.edu>.

Index: nnimap.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/nnimap.el,v
retrieving revision 6.39
diff -u -p -u -w -r6.39 nnimap.el
--- nnimap.el	2002/09/11 08:13:03	6.39
+++ nnimap.el	2002/09/17 11:05:39
@@ -1298,10 +1298,7 @@ function is generally only called when G
 (defun nnimap-expiry-target (arts group server)
   (unless (eq nnmail-expiry-target 'delete)
     (with-temp-buffer
-      (dolist (art (imap-search (concat "UID " 
-					(imap-range-to-message-set
-					 (gnus-uncompress-sequence arts)))
-		    nnimap-server-buffer))
+      (dolist (art arts)
 	(nnimap-request-article art group server  (current-buffer))
 	;; hints for optimization in `nnimap-request-accept-article'
 	(let ((nnimap-current-move-article art)
@@ -1320,16 +1317,16 @@ function is generally only called when G
 	(let ((days (or (and nnmail-expiry-wait-function
 			     (funcall nnmail-expiry-wait-function group))
 			nnmail-expiry-wait)))
-	  (cond (force
-		 (nnimap-expiry-target artseq group server)
-		 (when (imap-message-flags-add
-			(imap-range-to-message-set artseq) "\\Deleted")
-		   (setq articles nil)))
-		((eq days 'immediate)
-		 (nnimap-expiry-target artseq group server)
+	  (cond ((or force (eq days 'immediate))
+		 (let ((oldarts (imap-search
+				 (concat "UID " 
+					 (imap-range-to-message-set artseq)))))
+		   (when oldarts
+		     (nnimap-expiry-target oldarts group server))
 		 (when (imap-message-flags-add
-			(imap-range-to-message-set artseq) "\\Deleted")
-		   (setq articles nil)))
+			  (imap-range-to-message-set oldarts) "\\Deleted")
+		     (setq articles (gnus-set-difference
+				     articles oldarts)))))
 		((numberp days)
 		 (let ((oldarts (imap-search
 				 (format nnimap-expunge-search-string
@@ -1337,12 +1334,10 @@ function is generally only called when G
 					 (nnimap-date-days-ago days))))
 		       (imap-fetch-data-hook
 			'(nnimap-request-expire-articles-progress)))
-		   (nnimap-expiry-target oldarts group server)
-		   (and oldarts
-			(imap-message-flags-add
-			 (imap-range-to-message-set
-			  (gnus-compress-sequence oldarts))
-			 "\\Deleted")
+		   (when oldarts
+		     (nnimap-expiry-target oldarts group server))
+		   (when (imap-message-flags-add
+			  (imap-range-to-message-set oldarts) "\\Deleted")
 			(setq articles (gnus-set-difference
 					articles oldarts))))))))))
   ;; return articles not deleted




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Re: nnimap: error/warning while trying to quit group
  2002-09-17 10:26   ` Simon Josefsson
@ 2002-09-17 20:31     ` Nevin Kapur
  2002-09-18  9:53       ` Simon Josefsson
  0 siblings, 1 reply; 5+ messages in thread
From: Nevin Kapur @ 2002-09-17 20:31 UTC (permalink / raw)


Simon Josefsson <jas@extundo.com> writes:

> It looks fine, thanks. A code cleanup seems to be in order though, can
> you test this patch?  (On some unimportant groups, preferably.)
>
> 2002-09-17  Simon Josefsson  <jas@extundo.com>

It generates an error.  Here's *imap-log*:

2861 UID SEARCH UID 1460:1784,1786:2440,2442:2520,2522:2556,2558:2566 NOT SINCE 17-Aug-2002
* SEARCH
2861 OK UID SEARCH completed
2862 UID STORE  +FLAGS (\Deleted)
2862 BAD Missing or invalid argument to UID STORE
2863 EXPUNGE
2863 OK No messages deleted, so no update needed

Making the flag addition conditional too fixed the error for me.  With
the fix, I tested it on a group and expiry happened as expected:

Index: nnimap.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/nnimap.el,v
retrieving revision 6.40
diff -u -r6.40 nnimap.el
--- nnimap.el	2002/09/17 20:27:21	6.40
+++ nnimap.el	2002/09/17 21:09:09
@@ -1322,11 +1322,11 @@
 				 (concat "UID " 
 					 (imap-range-to-message-set artseq)))))
 		   (when oldarts
-		     (nnimap-expiry-target oldarts group server))
-		   (when (imap-message-flags-add
-			  (imap-range-to-message-set oldarts) "\\Deleted")
-		     (setq articles (gnus-set-difference
-				     articles oldarts)))))
+		     (nnimap-expiry-target oldarts group server)
+		     (when (imap-message-flags-add
+			    (imap-range-to-message-set oldarts) "\\Deleted")
+		       (setq articles (gnus-set-difference
+				       articles oldarts))))))
 		((numberp days)
 		 (let ((oldarts (imap-search
 				 (format nnimap-expunge-search-string
@@ -1335,11 +1335,11 @@
 		       (imap-fetch-data-hook
 			'(nnimap-request-expire-articles-progress)))
 		   (when oldarts
-		     (nnimap-expiry-target oldarts group server))
-		   (when (imap-message-flags-add
-			  (imap-range-to-message-set oldarts) "\\Deleted")
-		     (setq articles (gnus-set-difference 
-				     articles oldarts))))))))))
+		     (nnimap-expiry-target oldarts group server)
+		     (when (imap-message-flags-add
+			    (imap-range-to-message-set oldarts) "\\Deleted")
+		       (setq articles (gnus-set-difference 
+				       articles oldarts)))))))))))
   ;; return articles not deleted
   articles)
 







^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Re: nnimap: error/warning while trying to quit group
  2002-09-17 20:31     ` Nevin Kapur
@ 2002-09-18  9:53       ` Simon Josefsson
  0 siblings, 0 replies; 5+ messages in thread
From: Simon Josefsson @ 2002-09-18  9:53 UTC (permalink / raw)


Nevin Kapur <nevin@jhu.edu> writes:

> Simon Josefsson <jas@extundo.com> writes:
>
>> It looks fine, thanks. A code cleanup seems to be in order though, can
>> you test this patch?  (On some unimportant groups, preferably.)
>>
>> 2002-09-17  Simon Josefsson  <jas@extundo.com>
>
> It generates an error.  Here's *imap-log*:
>
> 2861 UID SEARCH UID 1460:1784,1786:2440,2442:2520,2522:2556,2558:2566 NOT SINCE 17-Aug-2002
> * SEARCH
> 2861 OK UID SEARCH completed
> 2862 UID STORE  +FLAGS (\Deleted)
> 2862 BAD Missing or invalid argument to UID STORE
> 2863 EXPUNGE
> 2863 OK No messages deleted, so no update needed
>
> Making the flag addition conditional too fixed the error for me.  With
> the fix, I tested it on a group and expiry happened as expected:

Ah, thanks, added.




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-09-18  9:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-16 13:54 nnimap: error/warning while trying to quit group Nevin Kapur
2002-09-16 15:39 ` [PATCH] " Nevin Kapur
2002-09-17 10:26   ` Simon Josefsson
2002-09-17 20:31     ` Nevin Kapur
2002-09-18  9:53       ` Simon Josefsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).