You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This affects Database::index_file and Database::remove_message, as these are only two functions documented to return this status. According to the docs for notmuch_database_index_file:
If 'message' is not NULL, then, on successful return
(NOTMUCH_STATUS_SUCCESS or NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID) '*message'
will be initialized to a message object that can be used for things
such as adding tags to the just-added message. The user should call
notmuch_message_destroy when done with the message. On any failure
'*message' will be set to NULL.
So not only is it not an error, it's also causing a memory leak, since the successful return value is discarded.
I think that it would be fine to fix this issue for the next patch release by treating NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID as successful unconditionally. For the next major release, we should perhaps be returning a tuple struct or something for these two functions (and maybe more that might have been missed) so that the caller can still receive this potentially useful status.
The text was updated successfully, but these errors were encountered:
elizagamedev
added a commit
to elizagamedev/notmuch-rs
that referenced
this issue
May 5, 2022
This affects
Database::index_file
andDatabase::remove_message
, as these are only two functions documented to return this status. According to the docs fornotmuch_database_index_file
:So not only is it not an error, it's also causing a memory leak, since the successful return value is discarded.
I think that it would be fine to fix this issue for the next patch release by treating
NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID
as successful unconditionally. For the next major release, we should perhaps be returning a tuple struct or something for these two functions (and maybe more that might have been missed) so that the caller can still receive this potentially useful status.The text was updated successfully, but these errors were encountered: