Re: [PATCH] test: change database from within pre-new hook

Subject: Re: [PATCH] test: change database from within pre-new hook

Date: Wed, 12 May 2021 09:23:15 +0200

To: David Bremner,


From: Michael J Gruber

David Bremner venit, vidit, dixit 2021-05-12 00:34:33:
> Michael J Gruber <> writes:
> > Due to the change in the config system, notmuch keeps a notmuch database
> > open when it would not do so before. Consequently, it can miss changes
> > to the database which are done from a hook (while notmuch holds the
> > databse in read only mode). When notmuch itself writes to the database
> > after that it uses wrong assumptions about the last used doc id etc.
> >
> > Demonstrate this by triggering an assertion. (This new test succeeds
> > with notmuch 0.31.4.)
> >
> > Signed-off-by: Michael J Gruber <>
> > ---
> >  test/ | 21 +++++++++++++++++++++
> >  1 file changed, 21 insertions(+)
> > +    notmuch search '*' > change.expected
> That line looks like leftover debugging to me, so I deleted
> it. Otherwise it works fine, thanks for tracking down the bug and
> providing a test.

Thanks for the fix! I didn't put it in the commit message (because
that commit might go before for your patch), but the test succeeds with
your fix.

Sorry for the debug line - typical case of re-editing without

I was wondering if it's worthwhile to test also:
- that the change from pre hook is persistent (test for that msg)
- test the same for post (even though the db is closed before)

notmuch mailing list --
To unsubscribe send an email to