[MAGNOLIA-7054] ModuleConfigurationObservingManager does not reload when observed node itself is deleted Created: 01/Jun/17  Updated: 15/Jun/17

Status: Accepted
Project: Magnolia
Component/s: core
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Philip Mundt Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File MAGNOLIA-7054_test_showing_limitation.patch    
Issue Links:
causality
is causing MGNLPN-389 NPE when replacing new audience for v... Open
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Story Points: 8

 Description   

When using info.magnolia.cms.util.ModuleConfigurationObservingManager (or info.magnolia.cms.util.WorkspaceObservingManager) and registering specific paths to be observed no reload (#reload() occurs when the observed node itself is deleted.

From the jcr documentation (also see javax.jcr.observation.ObservationManager#addEventListener(EventListener, int, String absPath, boolean isDeep, String[], String[], boolean)):

12.5.3.4.1 Location
[...]
If isDeep is true, only events whose associated parent node is at or below absPath will be received.

Thus only events will be triggered for direct child nodes of absPath (i.e. the observed path).

Possible solution

Register an additional observer for the parent of the actual path but for javax.jcr.observation.Event#NODE_REMOVED event types only. Additional "filtering" would have to happen too.

Please find attached a test case for info.magnolia.observation.WorkspaceEventListenerRegistrationTest that shows the limitation (see #listenToDeletionOfRegisteredPathItself()).


Generated at Mon Feb 12 04:20:18 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.