Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
16.10.15
-
None
-
Unknown
-
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.