Skip to content

Conversation

@kesselb
Copy link
Contributor

@kesselb kesselb commented Oct 30, 2024

Summary

Revert 9992e7d
Revert d2bf361
Revert e202896

TODO

  • ...

Checklist

@kesselb kesselb force-pushed the bug/48678/restore-dav-error-response branch 3 times, most recently from 5e998fb to 305cf4a Compare October 30, 2024 17:15
…eption output"

This reverts commit e202896.

Signed-off-by: Daniel Kesselberg <[email protected]>
This reverts commit d2bf361.

Signed-off-by: Daniel Kesselberg <[email protected]>
@kesselb kesselb force-pushed the bug/48678/restore-dav-error-response branch from 305cf4a to ca3733d Compare November 22, 2024 15:17
@kesselb kesselb marked this pull request as ready for review November 22, 2024 15:43
@kesselb kesselb requested review from artonge and nickvergessen and removed request for miaulalala November 22, 2024 15:43
@kesselb kesselb added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Nov 22, 2024
@miaulalala miaulalala merged commit 1abe9de into master Nov 25, 2024
191 checks passed
@miaulalala miaulalala deleted the bug/48678/restore-dav-error-response branch November 25, 2024 11:29
@kesselb
Copy link
Contributor Author

kesselb commented Nov 25, 2024

/backport to stable30

@kesselb
Copy link
Contributor Author

kesselb commented Nov 25, 2024

/backport to stable29

@kesselb
Copy link
Contributor Author

kesselb commented Nov 25, 2024

/backport to stable28

@kesselb
Copy link
Contributor Author

kesselb commented Nov 28, 2024

Test case 1: Report with unsupported limit

curl -X REPORT "https://server30.internal/remote.php/dav/calendars/admin30/personal/" \
    -H "Content-Type: application/xml" \
    -H "Cookie: XDEBUG_SESSION=PHPSTORM" \
    -d '<sync-collection xmlns="DAV:">
<sync-token />
    <sync-level>1</sync-level>
    <limit>
    <nresults>100</nresults>
    </limit>
    <prop>
    <getetag />
    </prop>
</sync-collection>' \
    --basic --user admin30:admin30

Expected outcome:

<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>OCA\DAV\Exception\UnsupportedLimitOnInitialSyncException</s:exception>
  <s:message/>
  <d:number-of-matches-within-limits/>
</d:error>

@kesselb
Copy link
Contributor Author

kesselb commented Nov 28, 2024

Test case 2: Mask type errors

  1. Patch photos app
  2. Create album "Test"
  3. Send http request
Index: lib/Sabre/PropFindPlugin.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/lib/Sabre/PropFindPlugin.php b/lib/Sabre/PropFindPlugin.php
--- a/lib/Sabre/PropFindPlugin.php	(revision c30f81f85f372981fc603ee9a0c998524c6f5a0d)
+++ b/lib/Sabre/PropFindPlugin.php	(date 1732785829587)
@@ -131,9 +131,9 @@
 		$node = $this->tree->getNodeForPath($path);
 		if ($node instanceof AlbumRoot) {
 			$propPatch->handle(self::LOCATION_PROPERTYNAME, function ($location) use ($node) {
-				if ($location instanceof Complex) {
-					$location = $location->getXml();
-				}
+//				if ($location instanceof Complex) {
+//					$location = $location->getXml();
+//				}
 
 				$this->albumMapper->setLocation($node->getAlbum()->getAlbum()->getId(), $location);
 				return true;
curl -X PROPPATCH "https://server30.internal/remote.php/dav/photos/admin30/albums/Test" \
    -H "OCS-APIRequest: true" \
    -H "Content-Type: application/xml" \
    -H "Cookie: XDEBUG_SESSION=PHPSTORM" \
    -d '<?xml version="1.0"?>
<d:propertyupdate xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns"
				  xmlns:nc="http://nextcloud.org/ns"
				  xmlns:ocs="http://open-collaboration-services.org/ns">
	<d:set>
		<d:prop>
			<nc:location>
				<a></a>
			</nc:location>
		</d:prop>
	</d:set>
</d:propertyupdate>' \
    --basic --user admin30:admin30

Expected outcome with debug = false:

Internal server error without stack trace.

@nextcloud nextcloud deleted a comment from sorbaugh Dec 19, 2024
@kesselb kesselb changed the title Bug/48678/restore dav error response Restore dav error response Dec 22, 2024
@kesselb kesselb mentioned this pull request Dec 22, 2024
4 tasks
@skjnldsv skjnldsv mentioned this pull request Jan 7, 2025
@kesselb kesselb mentioned this pull request Jan 28, 2025
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants