[ 
https://issues.apache.org/jira/browse/SLING-12245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17815578#comment-17815578
 ] 

Konrad Windszus edited comment on SLING-12245 at 2/8/24 8:50 AM:
-----------------------------------------------------------------

Just to clarify: The ResourceChangeListener in 
https://github.com/apache/sling-org-apache-sling-rewriter/blob/4d1952648e35e7001236f282040a78479f7726d4/src/main/java/org/apache/sling/rewriter/impl/ProcessorManagerImpl.java#L134
 is notified both about REMOVED and ADDED *outside* the path (i.e. for the 
ancestor node) as the filter method in 
https://github.com/apache/sling-org-apache-sling-resourceresolver/blob/6cfe4c3cb3a532ebfcabe13ae0028b71fb20996e/src/main/java/org/apache/sling/resourceresolver/impl/observation/BasicObservationReporter.java#L205C39-L205C52
 doesn't consider the path restriction at all!

The only difference is that for REMOVED it is also notified about sub resources.

I don't think there is a reasonable fix inside the Sling Rewriter, but rather 
this requires a better approach in 
https://github.com/apache/sling-org-apache-sling-jcr-resource/blob/master/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceListener.java
 or 
https://github.com/apache/sling-org-apache-sling-jcr-resource/blob/master/src/main/java/org/apache/sling/jcr/resource/internal/JcrListenerBaseConfig.java
 to tackle node moves. Any other idea for fixing this except for another flag 
for Oak to also emit "NODE_ADDED" events for all moved child nodes?


was (Author: kwin):
Just to clarify: The ResourceChangeListener in 
https://github.com/apache/sling-org-apache-sling-rewriter/blob/4d1952648e35e7001236f282040a78479f7726d4/src/main/java/org/apache/sling/rewriter/impl/ProcessorManagerImpl.java#L134
 is notified both about REMOVED and ADDED *outside* the path (i.e. for the 
ancestor node) as the filter method in 
https://github.com/apache/sling-org-apache-sling-resourceresolver/blob/6cfe4c3cb3a532ebfcabe13ae0028b71fb20996e/src/main/java/org/apache/sling/resourceresolver/impl/observation/BasicObservationReporter.java#L205C39-L205C52
 doesn't consider the path restriction at all!

The only difference is that for REMOVED it is also notified about sub resources.

I don't think there is a reasonable fix inside the Sling Rewriter, but rather 
this requires a better approach in 
https://github.com/apache/sling-org-apache-sling-jcr-resource/blob/master/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceListener.java
 to tackle node moves. Any other idea for fixing this except for another flag 
for Oak to also emit "NODE_ADDED" events for all moved child nodes?

> Sling Rewriter does not detect configuration changes coming in via move
> -----------------------------------------------------------------------
>
>                 Key: SLING-12245
>                 URL: https://issues.apache.org/jira/browse/SLING-12245
>             Project: Sling
>          Issue Type: Improvement
>    Affects Versions: Rewriter 1.3.10
>            Reporter: Konrad Windszus
>            Priority: Major
>
> If one renames/moves a JCR node from {{/apps/my/config/invalid-rewriter}} to 
> {{/apps/my/config/rewriter}} the new rewriter configuration is not being 
> detected by the {{ProcessorManagerImpl}} due to the 
> {{ResourceChangeListener}} only being configured to listen for changes below 
> the {{rewriter}} resource 
> (https://github.com/apache/sling-org-apache-sling-rewriter/blob/4d1952648e35e7001236f282040a78479f7726d4/src/main/java/org/apache/sling/rewriter/impl/ProcessorManagerImpl.java#L69).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to