[jira] [Commented] (SLING-8974) Shows a 200 OK for a delete operation even if the node does not exist.

2023-11-24 Thread Patrique Legault (Jira)


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

Patrique Legault commented on SLING-8974:
-

I tested this locally as well as wrote a unit test on the DeleteOperation to 
validate that the operation fails on a NonExistingResource and returns a 400 
from the PostServlet. 

The unit tests pass and the E2E pass as well.

> Shows a 200 OK for a delete operation even if the node does not exist.
> --
>
> Key: SLING-8974
> URL: https://issues.apache.org/jira/browse/SLING-8974
> Project: Sling
>  Issue Type: Bug
>  Components: Servlets
>Reporter: Anisha Narang
>Priority: Major
>
> When you try any curl query for a 'delete' operation, it shows a 200 OK even 
> even the node does not exist.
> curl query:
> {code:java}
> $ curl -F":operation=delete" http://slinghosturl.com/content/invalid_node
> 
> 
> Content modified /content/invalid_node
> 
> 
> Content modified /content/invalid_node
> 
> 
> 
> Status
> 200
> 
> 
> Message
> OK
> 
> 
> Location
>  id="Location">/invalid_node
> 
> 
> Parent Location
> /content
> 
> 
> Path
> /content/invalid_node
> 
> 
> Referer
> 
> 
> 
> ChangeLog
>  id="ChangeLog">predeleted(/content/invalid_node);br//pre
> 
> 
> 
> Modified Resource
> Parent of Modified Resource
> 
> {code}
> So, even though this node does not exist, there is a 200 OK response for the 
> same which is not expected as per the documentation here -> 
> [https://sling.apache.org/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-post.html#content-removal]
> Expected result:
> The response should be 404 not found if the not does not exist.



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


[jira] [Commented] (SLING-8974) Shows a 200 OK for a delete operation even if the node does not exist.

2023-09-13 Thread Robert Munteanu (Jira)


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

Robert Munteanu commented on SLING-8974:


Thinking about it some more, I think 400 would be a good compromise - 'bad 
request' since the client should know that the node does not exist.

> Shows a 200 OK for a delete operation even if the node does not exist.
> --
>
> Key: SLING-8974
> URL: https://issues.apache.org/jira/browse/SLING-8974
> Project: Sling
>  Issue Type: Bug
>  Components: Servlets
>Reporter: Anisha Narang
>Priority: Major
>
> When you try any curl query for a 'delete' operation, it shows a 200 OK even 
> even the node does not exist.
> curl query:
> {code:java}
> $ curl -F":operation=delete" http://slinghosturl.com/content/invalid_node
> 
> 
> Content modified /content/invalid_node
> 
> 
> Content modified /content/invalid_node
> 
> 
> 
> Status
> 200
> 
> 
> Message
> OK
> 
> 
> Location
>  id="Location">/invalid_node
> 
> 
> Parent Location
> /content
> 
> 
> Path
> /content/invalid_node
> 
> 
> Referer
> 
> 
> 
> ChangeLog
>  id="ChangeLog">predeleted(/content/invalid_node);br//pre
> 
> 
> 
> Modified Resource
> Parent of Modified Resource
> 
> {code}
> So, even though this node does not exist, there is a 200 OK response for the 
> same which is not expected as per the documentation here -> 
> [https://sling.apache.org/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-post.html#content-removal]
> Expected result:
> The response should be 404 not found if the not does not exist.



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


[jira] [Commented] (SLING-8974) Shows a 200 OK for a delete operation even if the node does not exist.

2020-01-13 Thread Robert Munteanu (Jira)


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

Robert Munteanu commented on SLING-8974:


[~enorman] - I agree that both operations should return identical results, and 
- as you said - we should not list invalid changelog entries.

On the broader issue, I think that a 200 OK return code when trying to delete 
an inexisting resource is incorrect. I would like to know if the resource was 
actually deleted, otherwise this can hide programming errors.

> Shows a 200 OK for a delete operation even if the node does not exist.
> --
>
> Key: SLING-8974
> URL: https://issues.apache.org/jira/browse/SLING-8974
> Project: Sling
>  Issue Type: Bug
>  Components: Servlets
>Reporter: Anisha Narang
>Priority: Major
> Fix For: Servlets POST 2.3.38
>
>
> When you try any curl query for a 'delete' operation, it shows a 200 OK even 
> even the node does not exist.
> curl query:
> {code:java}
> $ curl -F":operation=delete" http://slinghosturl.com/content/invalid_node
> 
> 
> Content modified /content/invalid_node
> 
> 
> Content modified /content/invalid_node
> 
> 
> 
> Status
> 200
> 
> 
> Message
> OK
> 
> 
> Location
>  id="Location">/invalid_node
> 
> 
> Parent Location
> /content
> 
> 
> Path
> /content/invalid_node
> 
> 
> Referer
> 
> 
> 
> ChangeLog
>  id="ChangeLog">predeleted(/content/invalid_node);br//pre
> 
> 
> 
> Modified Resource
> Parent of Modified Resource
> 
> {code}
> So, even though this node does not exist, there is a 200 OK response for the 
> same which is not expected as per the documentation here -> 
> [https://sling.apache.org/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-post.html#content-removal]
> Expected result:
> The response should be 404 not found if the not does not exist.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (SLING-8974) Shows a 200 OK for a delete operation even if the node does not exist.

2020-01-10 Thread Eric Norman (Jira)


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

Eric Norman commented on SLING-8974:


Obviously, the ChangeLog of the response shouldn't include deleted items that 
did not actually exist so that looks wrong, but is this a problem with the 
documentation or the implementation?

I would find it quite strange for the response to be different when the path to 
delete is supplied via a ":applyTo" parameter versus the inferred path when no 
":applyTo" request parameter is supplied.

In other words, wouldn't it would be more consistent for these two requests to 
return an identical response?
$ curl -F":operation=delete" http://slinghosturl.com/content/invalid_node
{code:java}
$ curl -F":operation=delete" -F":applyTo=/content/invalid_node" 
http://slinghosturl.com/content/invalid_node{code}
{color:#172b4d}So my question is should the "delete" operation always silently 
fail for any invalid paths or return an error when any of the paths where not 
valid?  For backward compatibility it should ignore invalid paths silently, but 
perhaps there is some interest in more "strict" interpretation of the request 
parameters?{color}

 

> Shows a 200 OK for a delete operation even if the node does not exist.
> --
>
> Key: SLING-8974
> URL: https://issues.apache.org/jira/browse/SLING-8974
> Project: Sling
>  Issue Type: Bug
>  Components: Servlets
>Reporter: Anisha Narang
>Priority: Major
> Fix For: Servlets POST 2.3.38
>
>
> When you try any curl query for a 'delete' operation, it shows a 200 OK even 
> even the node does not exist.
> curl query:
> {code:java}
> $ curl -F":operation=delete" http://slinghosturl.com/content/invalid_node
> 
> 
> Content modified /content/invalid_node
> 
> 
> Content modified /content/invalid_node
> 
> 
> 
> Status
> 200
> 
> 
> Message
> OK
> 
> 
> Location
>  id="Location">/invalid_node
> 
> 
> Parent Location
> /content
> 
> 
> Path
> /content/invalid_node
> 
> 
> Referer
> 
> 
> 
> ChangeLog
>  id="ChangeLog">predeleted(/content/invalid_node);br//pre
> 
> 
> 
> Modified Resource
> Parent of Modified Resource
> 
> {code}
> So, even though this node does not exist, there is a 200 OK response for the 
> same which is not expected as per the documentation here -> 
> [https://sling.apache.org/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-post.html#content-removal]
> Expected result:
> The response should be 404 not found if the not does not exist.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (SLING-8974) Shows a 200 OK for a delete operation even if the node does not exist.

2020-01-09 Thread Anisha Narang (Jira)


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

Anisha Narang commented on SLING-8974:
--

[~rombert] that's awesome, thanks. :)

> Shows a 200 OK for a delete operation even if the node does not exist.
> --
>
> Key: SLING-8974
> URL: https://issues.apache.org/jira/browse/SLING-8974
> Project: Sling
>  Issue Type: Bug
>  Components: Servlets
>Reporter: Anisha Narang
>Priority: Major
> Fix For: Servlets POST 2.3.38
>
>
> When you try any curl query for a 'delete' operation, it shows a 200 OK even 
> even the node does not exist.
> curl query:
> {code:java}
> $ curl -F":operation=delete" http://slinghosturl.com/content/invalid_node
> 
> 
> Content modified /content/invalid_node
> 
> 
> Content modified /content/invalid_node
> 
> 
> 
> Status
> 200
> 
> 
> Message
> OK
> 
> 
> Location
>  id="Location">/invalid_node
> 
> 
> Parent Location
> /content
> 
> 
> Path
> /content/invalid_node
> 
> 
> Referer
> 
> 
> 
> ChangeLog
>  id="ChangeLog">predeleted(/content/invalid_node);br//pre
> 
> 
> 
> Modified Resource
> Parent of Modified Resource
> 
> {code}
> So, even though this node does not exist, there is a 200 OK response for the 
> same which is not expected as per the documentation here -> 
> [https://sling.apache.org/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-post.html#content-removal]
> Expected result:
> The response should be 404 not found if the not does not exist.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (SLING-8974) Shows a 200 OK for a delete operation even if the node does not exist.

2020-01-09 Thread Robert Munteanu (Jira)


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

Robert Munteanu commented on SLING-8974:


Thank you for the report [~anarang]. This definitely looks like a bug and I've 
marked it for the next servlets POST release, to be taken into consideration.

Of course, if you have the option of sending a pull request, the fix will land 
sooner :-)

> Shows a 200 OK for a delete operation even if the node does not exist.
> --
>
> Key: SLING-8974
> URL: https://issues.apache.org/jira/browse/SLING-8974
> Project: Sling
>  Issue Type: Bug
>  Components: Servlets
>Reporter: Anisha Narang
>Priority: Major
> Fix For: Servlets POST 2.3.38
>
>
> When you try any curl query for a 'delete' operation, it shows a 200 OK even 
> even the node does not exist.
> curl query:
> {code:java}
> $ curl -F":operation=delete" http://slinghosturl.com/content/invalid_node
> 
> 
> Content modified /content/invalid_node
> 
> 
> Content modified /content/invalid_node
> 
> 
> 
> Status
> 200
> 
> 
> Message
> OK
> 
> 
> Location
>  id="Location">/invalid_node
> 
> 
> Parent Location
> /content
> 
> 
> Path
> /content/invalid_node
> 
> 
> Referer
> 
> 
> 
> ChangeLog
>  id="ChangeLog">predeleted(/content/invalid_node);br//pre
> 
> 
> 
> Modified Resource
> Parent of Modified Resource
> 
> {code}
> So, even though this node does not exist, there is a 200 OK response for the 
> same which is not expected as per the documentation here -> 
> [https://sling.apache.org/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-post.html#content-removal]
> Expected result:
> The response should be 404 not found if the not does not exist.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)