<feed xmlns='http://www.w3.org/2005/Atom'>
<title>notmuch/lib/database.cc, branch 0.4</title>
<subtitle>thread-based email index, search, and tagging</subtitle>
<id>https://git.notmuchmail.org/git/notmuch/atom?h=0.4</id>
<link rel='self' href='https://git.notmuchmail.org/git/notmuch/atom?h=0.4'/>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/'/>
<updated>2010-11-02T06:24:40Z</updated>
<entry>
<title>lib: Eliminate some redundant includes of xapian.h</title>
<updated>2010-11-02T06:24:40Z</updated>
<author>
<name>Carl Worth</name>
<email>cworth@cworth.org</email>
</author>
<published>2010-11-02T05:31:45Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=d064bd696ccc443a7ece9cfc8816999c69943223'/>
<id>urn:sha1:d064bd696ccc443a7ece9cfc8816999c69943223</id>
<content type='text'>
Most files including this already include database-private.h which
includes xapian.h already.
</content>
</entry>
<entry>
<title>lib: Add some missing static qualifiers.</title>
<updated>2010-11-02T04:58:43Z</updated>
<author>
<name>Carl Worth</name>
<email>cworth@cworth.org</email>
</author>
<published>2010-11-02T04:58:43Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=67c3bc9db48c9e12d648df4792c706cae723676c'/>
<id>urn:sha1:67c3bc9db48c9e12d648df4792c706cae723676c</id>
<content type='text'>
These various functions and data are all used only locally, so should
be marked static. Ensuring we get these right will avoid us accidentally
leaking unintended symbols through the library interface.
</content>
</entry>
<entry>
<title>lib: Fix use-after-free bug.</title>
<updated>2010-09-20T22:01:52Z</updated>
<author>
<name>Carl Worth</name>
<email>cworth@cworth.org</email>
</author>
<published>2010-09-20T22:01:52Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=029830c1f130b3780684d056c01a73061090f15f'/>
<id>urn:sha1:029830c1f130b3780684d056c01a73061090f15f</id>
<content type='text'>
Thanks to the new git-based test suite, it's easy to run the whole
test suite in valgrind, (simply "make test OPTIONS="--valgrind"), and
doing so showed this obvious use-after-free bug, (triggered by the
thread-order tests).
</content>
</entry>
<entry>
<title>Add support (and tests) for messages with really long message IDs.</title>
<updated>2010-06-04T20:35:07Z</updated>
<author>
<name>Carl Worth</name>
<email>cworth@cworth.org</email>
</author>
<published>2010-06-04T19:39:36Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=7b78eb4af6e87532795d09bd82152002ab4a74b1'/>
<id>urn:sha1:7b78eb4af6e87532795d09bd82152002ab4a74b1</id>
<content type='text'>
Scott Henson reported an internal error that occurred when he tried to
add a message that referenced another message with a message ID well
over 300 characters in length. The bug here was running into a Xapian
limit for the length of metadata key names, (which is even more
restrictive than the Xapian limit for the length of terms).

We fix this by noticing long message ID values and instead using a
message ID of the form "notmuch-sha1-&lt;sha1_sum_of_message_id&gt;". That
is, we use SHA1 to generate a compressed, (but still unique), version
of the message ID.

We add support to the test suite to exercise this fix. The tests add a
message referencing the long message ID, then add the message with the
long message ID, then finally add another message referencing the long
ID. Each of these tests exercise different code paths where the
special handling is implemented.

A final test ensures that all three messages are stitched together
into a single thread---guaranteeing that the three code paths all act
consistently.
</content>
</entry>
<entry>
<title>Avoid database corruption by not adding partially-constructed mail documents.</title>
<updated>2010-06-04T17:16:53Z</updated>
<author>
<name>Carl Worth</name>
<email>cworth@cworth.org</email>
</author>
<published>2010-06-04T17:16:53Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=98845fdbb2a4acaa0036f8e2e998e726b18e6b13'/>
<id>urn:sha1:98845fdbb2a4acaa0036f8e2e998e726b18e6b13</id>
<content type='text'>
Previously we were using Xapian's add_document to allocate document ID
values for notmuch_message_t objects.  This had the drawback of adding
a partially constructed mail document to the database. If notmuch was
subsequently interrupted before fully populating this document, then
later runs would be quite confused when seeing the partial documents.

There are reports from the wild of people hitting internal errors of
the form "Message ... has no thread ID" for example, (which is
currently an unrecoverable error).

We fix this by manually allocating document IDs without adding
documents. With this change, we never call Xapian's add_document
method, but only replace_document with either the current document ID
of a message or a new one that we have allocated.
</content>
</entry>
<entry>
<title>lib: Audit all notmuch_database call for Xapian exception handling.</title>
<updated>2010-04-24T14:27:50Z</updated>
<author>
<name>Carl Worth</name>
<email>cworth@cworth.org</email>
</author>
<published>2010-04-24T14:22:34Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=9ef68f1444de981c47af06c948e3aa3ca5a377c8'/>
<id>urn:sha1:9ef68f1444de981c47af06c948e3aa3ca5a377c8</id>
<content type='text'>
Our current approach is for top-level entry poitns in the library
to have try/catch blocks that catch any Xapian exception and print
a message. Add a few missing blocks and fix up the documentation.
</content>
</entry>
<entry>
<title>lib: Remove condition regarding a NULL parent_thread_id.</title>
<updated>2010-04-12T22:54:03Z</updated>
<author>
<name>Carl Worth</name>
<email>cworth@cworth.org</email>
</author>
<published>2010-04-12T22:54:03Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=14073b8851067db4dbf5727bf1f5547a66750934'/>
<id>urn:sha1:14073b8851067db4dbf5727bf1f5547a66750934</id>
<content type='text'>
A recent change guaranteed that a message ID can never be resolved
to a NULL thread ID, so we don't need this extra case.
</content>
</entry>
<entry>
<title>lib: Always add reference terms to the database.</title>
<updated>2010-04-12T22:45:40Z</updated>
<author>
<name>Carl Worth</name>
<email>cworth@cworth.org</email>
</author>
<published>2010-04-12T22:45:40Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=071022c253a6c2fbf445478619d1a32d945be438'/>
<id>urn:sha1:071022c253a6c2fbf445478619d1a32d945be438</id>
<content type='text'>
Previously, we were only adding the reference terms for cases where
the referenced message did not yet exist in the database. For thread
presentation, it's useful to have the connection information provided
by the references, even when the messages are present. So add this
term unconditionally.
</content>
</entry>
<entry>
<title>lib: Document the metadata stored within the Xapian database.</title>
<updated>2010-04-12T22:15:14Z</updated>
<author>
<name>Carl Worth</name>
<email>cworth@cworth.org</email>
</author>
<published>2010-04-12T22:15:14Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=328626d0fd17910eec5d8b5b51dda46f4bbd8189'/>
<id>urn:sha1:328626d0fd17910eec5d8b5b51dda46f4bbd8189</id>
<content type='text'>
We are currently storing "version", "last_thread_id", and
"thread_id_*" values so document how each of these are used.
</content>
</entry>
<entry>
<title>lib: Fix line-wrapping in _notmuch_database_link_message.</title>
<updated>2010-04-12T21:41:34Z</updated>
<author>
<name>Carl Worth</name>
<email>cworth@cworth.org</email>
</author>
<published>2010-04-12T21:41:34Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=af49741228ec1582c83e266dbb8d6551f015d610'/>
<id>urn:sha1:af49741228ec1582c83e266dbb8d6551f015d610</id>
<content type='text'>
This function had some excessively long lines due to nested
expressions. It's simple enough to un-nest these and have readable
line lengths.
</content>
</entry>
</feed>
