Problem After upgrading the Change Request application on a running instance, the change request events can stop being recorded: the timeline of the change requests (Description tab) doesn't show any new event anymore (creation, status change, review, comment...) and the related notifications are not sent. Only a restart of the instance makes them work again, and the events triggered in the meantime are lost. This happened on xwiki.org after the upgrade to 1.26 on 2026-11-03: no changerequest.* event has been stored since then, while the other events are stored normally. The same symptom was reported in CRAPP-374 (and CRAPP-373) on 1.16 without its cause being identified. Cause At the end of an extension job that upgrades a JAR extension, all the JAR extensions of the root namespace are unloaded and loaded again, one JAR after the other. When the components of a JAR are registered, the observation manager instantiates its event listeners right away, and if that fails it logs the following error in the job log and ignores the listener until the next restart:
The listeners of application-changerequest-notifications (through ChangeRequestRecordableEventNotifier) require components implemented in application-changerequest-default, such as DocumentReferenceResolver<ChangeRequest> or ChangeRequestStorageManager. However application-changerequest-notifications only depends on application-changerequest-default with the test scope, so nothing ensures that application-changerequest-default is loaded first: when it's loaded after, all the notifications listeners are dropped. The issue doesn't happen at startup, since the listeners are only instantiated once all the extensions are loaded. |