about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-05-23 21:36:51 +0000
committerEric Wong <e@80x24.org>2021-05-24 22:31:37 +0000
commit05727fbf963bee726e99e383855567235cc3d9ba (patch)
treecb4c826692c851e6acbbeea392b943d8355d97d1 /lib
parenta9bfba8eb31dbb4cdb8306496a911a84f8ac6e04 (diff)
downloadpublic-inbox-05727fbf963bee726e99e383855567235cc3d9ba.tar.gz
It's inappropriate to store sync information without
UIDVALIDITY, so add an assertion to prevent it.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/LeiMailSync.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/PublicInbox/LeiMailSync.pm b/lib/PublicInbox/LeiMailSync.pm
index b2986686..63076fa1 100644
--- a/lib/PublicInbox/LeiMailSync.pm
+++ b/lib/PublicInbox/LeiMailSync.pm
@@ -7,6 +7,7 @@ use strict;
 use v5.10.1;
 use DBI;
 use PublicInbox::ContentHash qw(git_sha);
+use Carp ();
 
 sub dbh_new {
         my ($self, $rw) = @_;
@@ -88,6 +89,10 @@ UPDATE folders SET loc = ? WHERE fid = ?
 EOM
                         return $fid;
                 }
+        } elsif ($rw && $folder =~ m!\Aimaps?://!i) {
+                require PublicInbox::URIimap;
+                PublicInbox::URIimap->new($folder)->uidvalidity //
+                        Carp::croak("BUG: $folder has no UIDVALIDITY");
         }
         return unless $rw;