This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-cf73b5c3-acdc-4b5b-9013-05a5a6da09e6 XWIKI-23839 Open

Listener not correctly registred while upgrading extension

 
View issue   ·   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-02b9e812-f865-4852-9501-42db4191b63b Josué Tille created this issue on 22/Dec/25 08:19
 
Summary: Listener not correctly registred while upgrading extension
Issue Type: cid:jira-generated-image-avatar-cf73b5c3-acdc-4b5b-9013-05a5a6da09e6 Bug
Affects Versions: 16.10.15
Assignee: Unassigned
Created: 22/Dec/25 08:19
Priority: cid:jira-generated-image-static-major-944ff0ec-e6eb-4430-9a91-f944442745cc Major
Reporter: Josué Tille
Description:

Hello,

I had this issue with the OAuth2 client module but I suppose this issue could impact other extensions.

The main issue is that some listeners like the listener in the OAuth2 client module are not registered correctly after an extension is upgraded (which reloads all classes).

I was able to reproduce the issue with XWiki 16.10.15 with org.xwiki.contrib.oidc:oauth2-client version 2.19.4. The process to reproduce the issue was:

  • Put a breakpoint here
  • Create in Sandbox a object of type XWiki.OAuth2.TokenClass.
  • Update the object in Sandbox. Normally the code should stop on the breakpoint.
  • Update any extension. For instance org.xwiki.contrib:macro-job.
  • Update again the object in Sandbox. Normally the code should not stop any more on the breakpoint because the listener is not called any more.

The issue is that the listenersByEvent list don't contains any more the OAuth2TokenStoreListener listener after the extension upgrade. And the reason of this is that the listener is added before being removed which could explain why the OAuth2TokenStoreListener are not registered any more.