From 51336e88f2de76c56b513de23d06677461742454 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Fri, 15 Nov 2019 22:20:40 +0100 Subject: =?UTF-8?q?Improve=20=E2=80=9CUIDVALIDITY=20changed!=E2=80=9D=20er?= =?UTF-8?q?ror=20message.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mention the name of the problematic mailbox. (We may detect the violation while not in SELECTED state.) --- lib/Net/IMAP/InterIMAP.pm | 4 ++-- tests/resume/t | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Net/IMAP/InterIMAP.pm b/lib/Net/IMAP/InterIMAP.pm index ef1c20b..1bff06e 100644 --- a/lib/Net/IMAP/InterIMAP.pm +++ b/lib/Net/IMAP/InterIMAP.pm @@ -1111,7 +1111,7 @@ sub set_cache($$%) { if ($k eq 'UIDVALIDITY') { # try to detect UIDVALIDITY changes early (before starting the sync) $self->fail("UIDVALIDITY changed! ($cache->{UIDVALIDITY} != $v) ". - "Need to invalidate the UID cache.") + "Need to invalidate the UID cache for $mailbox.") if defined $cache->{UIDVALIDITY} and $cache->{UIDVALIDITY} != $v; } $cache->{$k} = $v; @@ -1819,7 +1819,7 @@ sub _update_cache_for($$%) { if ($k eq 'UIDVALIDITY') { # try to detect UIDVALIDITY changes early (before starting the sync) $self->fail("UIDVALIDITY changed! ($cache->{UIDVALIDITY} != $v) ". - "Need to invalidate the UID cache.") + "Need to invalidate the UID cache for $mailbox.") if defined $cache->{UIDVALIDITY} and $cache->{UIDVALIDITY} != $v; $self->{_PCACHE}->{$mailbox}->{UIDVALIDITY} //= $v; } diff --git a/tests/resume/t b/tests/resume/t index cb0208c..a281ef3 100644 --- a/tests/resume/t +++ b/tests/resume/t @@ -38,7 +38,7 @@ doveadm -u "remote" mailbox status "all" "foo" >"$TMPDIR/foo.remote" ! interimap || error grep -Fx "Resuming interrupted sync for foo" <"$STDERR" -grep -Fx "local(foo): ERROR: UIDVALIDITY changed! ($uidvalidity2 != $uidvalidity) Need to invalidate the UID cache." <"$STDERR" +grep -Fx "local(foo): ERROR: UIDVALIDITY changed! ($uidvalidity2 != $uidvalidity) Need to invalidate the UID cache for foo." <"$STDERR" sqlite3 "$XDG_DATA_HOME/interimap/remote.db" >"$TMPDIR/dump2.sql" <<-EOF .dump -- cgit v1.2.3