[jira] [Commented] (SLING-12245) Sling Rewriter does not detect configuration changes coming in via move

2024-02-08 Thread Carsten Ziegeler (Jira)


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

Carsten Ziegeler commented on SLING-12245:
--

Sure, I see the general problem - for the rewriter the approach sounds fine to 
me

> 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)


[jira] [Commented] (SLING-12245) Sling Rewriter does not detect configuration changes coming in via move

2024-02-08 Thread Konrad Windszus (Jira)


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

Konrad Windszus commented on SLING-12245:
-

The receiver does not know if it is ADDED event due to a move operation or a 
regular ADDED event. Only in the former case a traversal is necessary. If you 
do it for every ADDED event outside the path there is a high chance that you 
treat the same configuration twice (e.g. when adding a configuration via 
content package) which will first trigger an ADDED event on the ancestor as 
well followed by the ADDED event on the actual configuration resource.

> 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)


[jira] [Commented] (SLING-12245) Sling Rewriter does not detect configuration changes coming in via move

2024-02-08 Thread Carsten Ziegeler (Jira)


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

Carsten Ziegeler commented on SLING-12245:
--

I think that's what the listener has to do. And in this case it's not super hard

> 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)


[jira] [Commented] (SLING-12245) Sling Rewriter does not detect configuration changes coming in via move

2024-02-08 Thread Konrad Windszus (Jira)


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

Konrad Windszus commented on SLING-12245:
-

bq. So isn't the fix to not ignore the event?

This will be hard, as the receiver only receives an ADDED for an ancestor node. 
It doesn't know about potentially other following ADDED events. One would need 
to traverse the full child nodes (which can be huge e.g. for renamed level 1 
nodes) to see if that contains a relevant resource name.

> 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)


[jira] [Commented] (SLING-12245) Sling Rewriter does not detect configuration changes coming in via move

2024-02-08 Thread Carsten Ziegeler (Jira)


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

Carsten Ziegeler commented on SLING-12245:
--

[~kwin] I'm not sure I fully understand the problem. You mention "When renaming 
a working rewriter pipeline config from /apps/system/config/rewriter2 to 
/apps/system/config/rewriter the following ResourceChange is received:..." 
which is ignored in ProcessorManagerImpl.onChange(...)
So isn't the fix to not ignore the event?

> 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)


[jira] [Commented] (SLING-12245) Sling Rewriter does not detect configuration changes coming in via move

2024-02-08 Thread Konrad Windszus (Jira)


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

Konrad Windszus commented on SLING-12245:
-

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)


[jira] [Commented] (SLING-12245) Sling Rewriter does not detect configuration changes coming in via move

2024-02-07 Thread Konrad Windszus (Jira)


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

Konrad Windszus commented on SLING-12245:
-

[~cziegeler] Do we need another flag in Oak named {{withIncludeAncestorsAdd()}} 
similar to {{withIncludeAncestorsRemove}} introduced with OAK-5020? What was 
the original reason why only remove was considered in that flag in the first 
place?

> 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)


[jira] [Commented] (SLING-12245) Sling Rewriter does not detect configuration changes coming in via move

2024-02-07 Thread Konrad Windszus (Jira)


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

Konrad Windszus commented on SLING-12245:
-

Debugging revealed the following:

When renaming a working rewriter pipeline config from 
{{/apps/system/config/rewriter2}} to {{/apps/system/config/rewriter}} the 
following {{ResourceChange}} is received:
{code}
ResourceChange[type=ADDED, path=/apps/system/config/rewriter, external=false]
{code}
which is ignored in {{ProcessorManagerImpl.onChange(...)}}

However when renaming a working rewriter pipeline config from 
{{/apps/system/config/rewriter}} to {{/apps/system/config/rewriter2}} the 
following {{ResourceChanges}} are received:
{code}
ResourceChange[type=REMOVED, path=/apps/system/config/rewriter, external=false]
ResourceChange[type=REMOVED, path=/apps/system/config/rewriter/custom, 
external=false]
{code}
which leads to removing the config at {{/apps/system/config/rewriter}} in 
{{ProcessorManagerImpl.onChange(...)}} (in case it was previously registered).

> 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)