diff --git a/libervia/backend/plugins/plugin_xep_0402.py b/libervia/backend/plugins/plugin_xep_0402.py index 57a2ddd9..3a5f2948 100644 --- a/libervia/backend/plugins/plugin_xep_0402.py +++ b/libervia/backend/plugins/plugin_xep_0402.py @@ -20,7 +20,7 @@ from typing import Iterator, Self, cast from pydantic import BaseModel, Field, RootModel from twisted.internet import defer -from twisted.words.protocols.jabber import jid +from twisted.words.protocols.jabber import error, jid from twisted.words.protocols.jabber.xmlstream import TimeoutError from twisted.words.xish import domish from tx_xmpp import pubsub @@ -360,9 +360,17 @@ class XEP_0402: if await self.host.memory.disco.has_feature( client, NS_BOOKMARKS2_COMPAT, pep_jid ): - await self._p.retract_items( - client, client.jid.userhostJID(), NS_BOOKMARKS2, [bookmark_jid.full()] - ) + try: + await self._p.retract_items( + client, + client.jid.userhostJID(), + NS_BOOKMARKS2, + [bookmark_jid.full()], + ) + except error.StanzaError as e: + if e.condition != "item-not-found": + raise + # no bookmark to remove, nothing to do else: log.debug( f"[{client.profile}] No compatibility layer found, we use legacy "