Skip to content

fix(files): improve upload error handling for DAV responses#61058

Draft
joshtrichards wants to merge 3 commits into
masterfrom
jtr/fix-Files-DAV-Upload-Error-UX
Draft

fix(files): improve upload error handling for DAV responses#61058
joshtrichards wants to merge 3 commits into
masterfrom
jtr/fix-Files-DAV-Upload-Error-UX

Conversation

@joshtrichards

@joshtrichards joshtrichards commented Jun 7, 2026

Copy link
Copy Markdown
Member

Summary

Improve upload error handling in apps/files/src/views/FilesList.vue by parsing the DAV error payload before falling back to generic HTTP status handling.

This fixes cases where the frontend currently assumes:

  • any 403 means access control blocked the operation
  • any 404 or 409 means the target folder no longer exists

In practice, the DAV backend may include structured XML with more specific details such as:

  • s:exception
  • s:message
  • o:reason
  • o:retry
  • o:hint

This change makes the upload error handling more accurate by:

  • parsing DAV XML first when available
  • only showing the access-control-specific message when the DAV payload confirms that case
  • preferring DAV-provided error details over generic 404 / 409 assumptions
  • keeping generic fallback messages only when the response body does not provide anything better

Changes

  • add DAV error parsing helper(s) in FilesList.vue
  • detect access-control-specific 403 responses using the DAV exception payload
  • prefer o:reason / s:message over generic status-only messaging
  • keep 404 / 409 target-folder messaging as a fallback only
  • extend the quota/size-related upload handling to also account for 413

Follow-up note

There is a likely backend contract inconsistency worth reviewing separately:

  • OCP\Files\NotEnoughSpaceException is currently converted in DAV to EntityTooLarge / HTTP 413
  • semantically, insufficient storage may be better represented as 507 Insufficient Storage
  • if the backend intentionally keeps returning 413, it would be helpful to provide structured DAV payload hints so clients can reliably distinguish:
    • file too large
    • insufficient remaining space / quota

This PR does not change the backend contract; it only makes the frontend more robust against the current behavior.

TODO

  • See if E2E/integration need to be adjusted
  • Possibly backport to v34

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

…ming 403/404/409

Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards

Copy link
Copy Markdown
Member Author

/compile

Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards

Copy link
Copy Markdown
Member Author

/compile

Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@susnux susnux added the community pull requests from community label Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developing Work in progress bug community pull requests from community feature: files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error shown when file upload receives 403 references "access control" + never includes any additional explanation text sent on by server(s)

3 participants