mod_bookmarks2: Ignore failure to delete nothing (thanks Ge0rG)
Attempting to delete all bookmarks when the bookmarks node does not even
exist logged a fairly harmless error that we now ignore.
--- a/mod_bookmarks2/mod_bookmarks2.lua Sat Mar 19 17:52:33 2022 +0000
+++ b/mod_bookmarks2/mod_bookmarks2.lua Thu Mar 24 14:56:30 2022 +0100
@@ -155,7 +155,12 @@
if synchronise then
-- If we set zero legacy bookmarks, purge the bookmarks 2 node.
module:log("debug", "No bookmark in the set, purging instead.");
- return service:purge(namespace, jid, true);
+ local ok, err = service:purge(namespace, jid, true);
+ if not ok and err == "item-not-found" then
+ -- Nothing there already, all is well.
+ return true;
+ end
+ return ok, err;
else
return true;
end