]> Sergey Matveev's repositories - public-inbox.git/commitdiff
over: gracefully show invalid ibx_id
authorEric Wong <e@80x24.org>
Mon, 7 Dec 2020 07:40:49 +0000 (07:40 +0000)
committerEric Wong <e@80x24.org>
Tue, 8 Dec 2020 07:19:28 +0000 (07:19 +0000)
While "public-inbox-extindex --gc" invocations try to ensure
proper ordering, it is still possible for users to change
the `inboxes' tables via sqlite3(1) or similar means.  So
show a "missing://ibx_id=$ibx_id" placeholder to avoid undefined
variable warnings.

URLs such as "imaps://..." will eventually be supported as
eidx_keys, so having a URL-like "missing://" as a placeholder
probably makes sense.

lib/PublicInbox/Over.pm

index f34e7fc1cb23e10630ea3ab9334a1b4b47e61824..51284601bfc34fbb080ec8bfec5d1af01593e45b 100644 (file)
@@ -275,6 +275,7 @@ SELECT eidx_key FROM inboxes WHERE ibx_id = ?
                my $r = $_;
                $eidx_key_sth->execute($r->[0]);
                my $eidx_key = $eidx_key_sth->fetchrow_array;
+               $eidx_key //= "missing://ibx_id=$r->[0]";
                "$eidx_key:$r->[1]:".unpack('H*', $r->[2]);
        } @$rows ];
 }