This issue has been created
There are 5 updates.
 
 
XWiki Platform / cid:jira-generated-image-avatar-c8e9da32-3e99-42d1-ad56-696ebd15c2d6 XWIKI-25436 Open

Introduce events framing the deletion of a wiki

 
View issue   ·   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-3c76616d-8273-40da-9258-249f4f5b5dae Simon Urli created this issue on 21/Oct/26 14:12
 
Summary: Introduce events framing the deletion of a wiki
Issue Type: cid:jira-generated-image-avatar-c8e9da32-3e99-42d1-ad56-696ebd15c2d6 New Feature
Affects Versions: 17.10.14
Assignee: Unassigned
Components: Bridge, Wiki
Created: 21/Oct/26 14:12
Priority: cid:jira-generated-image-static-major-15d8f037-6d73-47d8-92ca-e8f0c7dea7b8 Major
Reporter: Simon Urli
Description:

Problem

The only event sent when a wiki is deleted is WikiDeletedEvent, and it is sent by DefaultWikiManager#delete once the wiki descriptor and the wiki database are already gone. A component which needs to read the wiki's data to clean up what it keeps about that wiki (indexes, caches, registered components, scheduled tasks…) cannot do it anymore at that point. Also, a listener receiving another event while the wiki is being deleted (for example the RightUpdatedEvent sent when the wiki descriptor document is deleted) has no way to know that this wiki is going away.

This leads to errors in the logs, or to data of the deleted wiki being kept, for example:

  • XWIKI-25420: the asynchronous rendering cache evaluates again, on the RightUpdatedEvent sent when the descriptor is deleted, the right checks of users of the wiki being deleted, which logs Failed to load rights errors.
  • XWIKI-9498: the Solr indexer keeps indexing the documents of the wiki being deleted. tmortagne: "we would probably need to introduce a WikiDeletingEvent since when receiving WikiDeletedEvent it's already too late".
  • XWIKI-9499: wiki components could not be unregistered by searching the wiki for them, because the search happens after the wiki is gone (a WikiDeletingEvent, possibly with a WikiDeleteFailedEvent, was proposed there).
  • XWIKI-18484: a UI extension with a global scope from a deleted subwiki displays an error in the main wiki.

Proposal

Frame the deletion of a wiki the same way its creation is framed by WikiCreatingEvent / WikiCreatedEvent / WikiCreateFailedEvent:

  • introduce WikiDeletingEvent (BeginFoldEvent), sent by DefaultWikiManager#delete before the wiki is deleted;
  • make WikiDeletedEvent an EndFoldEvent;
  • introduce WikiDeleteFailedEvent (EndEvent), sent when the deletion fails.

A listener can then either clean up what it keeps about the wiki on WikiDeletingEvent, while the wiki can still be read, or check the ObservationContext to know that an event is received during the deletion of a wiki.

Limitations

  • Like WikiDeletedEvent, the events are only sent when the wiki is deleted through the WikiManager, not when the wiki descriptor page is deleted directly (see XWIKI-19846).
  • The ObservationContext is only available in the thread performing the deletion (see XWIKI-19691 for the same problem with WikiCreatingEvent).
 
 

5 updates

 
cid:jira-generated-image-avatar-3c76616d-8273-40da-9258-249f4f5b5dae Changes by Simon Urli on 21/Oct/26 14:13
 
Fix Version: 17.10.15
Fix Version: 18.10.0-rc-1
Fix Version: 18.9.0
Fix Version: 18.4.8
Assignee: Simon Urli