`WebxdcInstanceDeleted` event is not emitted while deleting a chat
WebxdcInstanceDeleted event is used in desktop to delete webxdc browser data. It is not emitted when deleting a chat with webxdc instances.
I tested it on core v1.157.2.
that's true, thanks for the pointer!
alternatively, we can document, that UI should additionally listen to ChatDeleted
emitting WebxdcInstanceDeleted will cause additional database queries on chat deletion, maybe not not too bad, but still. there was a time, where we said, that events are low-level and shall not produce additional load :)
otoh, we're doing that effort already for ephemeral messages etc, so, yes, probably reasonable to emit the event additionally as well on chat deletion, even if that means additional queries
TBH it sounds unnecessary to me, if besides msgID also keep chatID of the open webxdc and listen to the chat deleted even you wouldnt need the additional event, hope firing it doesn't require go over all msgs in chat and check if some of them are webxdc
To a certain level just listening to the msgs event would probably have been enough also without the need for the "webxdc instance deleted" event but if we are going to have it anyways, it makes sense to fire it on chat deletion, otherwise it feels incomplete API
alternatively, we can document, that UI should additionally listen to ChatDeleted
I considered that first, but at least on desktop there is no easy way to find all webxdc data belonging to a chat. Though for account deletion it is already done that way (on account deletion it deletes all webxdc data), but there each account has their own directory, so it just deletes the whole directory