Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dav): Fix DAV functions to make work with them easier #725

Merged
merged 1 commit into from Aug 18, 2023

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Aug 11, 2023

  • davGetClient should default to the DAV remote URL instead of including the users root (to allow SEARCH)
  • getFavoriteNodes should work with any path
  • Add missing documentation

Because especially the getFavoriteNodes function was copied from the files app, but there is no reason why it should be restricted in this library to only support favorites on / but not on other paths (also the documentation said it would do).

@codecov
Copy link

codecov bot commented Aug 11, 2023

Codecov Report

Merging #725 (d33096d) into master (cd35f80) will decrease coverage by 0.26%.
The diff coverage is 87.50%.

@@            Coverage Diff             @@
##           master     #725      +/-   ##
==========================================
- Coverage   78.20%   77.94%   -0.26%     
==========================================
  Files          17       17              
  Lines         390      390              
  Branches      109      107       -2     
==========================================
- Hits          305      304       -1     
- Misses         72       73       +1     
  Partials       13       13              
Files Changed Coverage Δ
lib/dav/dav.ts 53.84% <87.50%> (-3.85%) ⬇️

@skjnldsv
Copy link
Contributor

Hummmm, this is a breaking change though.
I need to have a clear mind to think about this, too blurry today :)

@susnux
Copy link
Contributor Author

susnux commented Aug 15, 2023

@skjnldsv basically every beta version currently was breaking ;-)

There are two breaking changes here:

  1. Make get favorites do what the documentation of it says instead of returning all files for non root
  2. Change the root and remote URL constants, our documentation about the DAV endpoint in the developer docs says we always use the .../dav/ endpoint all API requests so we should provide this remote path and only append the users root is needed (e.g. requesting directory content).

@skjnldsv
Copy link
Contributor

basically every beta version currently was breaking ;-)

yes and no.
But right now we change the entire logic of the dav protocol.

What is the migration path for this change?

@susnux
Copy link
Contributor Author

susnux commented Aug 17, 2023

What is the migration path for this change?

Not much needed, querying favorites should work as before as the root is injected.
Only if you use the provided client you will have to make sure to use ${davRootPath}${path} for e.g. getDirectoryContent.

The client now is configured with the base url as in our documentation: https://docs.nextcloud.com/server/latest/developer_manual/client_apis/WebDAV/basic.html#webdav-basics

* `davGetClient` should default to the DAV remote URL instead of including the users root (to allow SEARCH)
* `getFavoriteNodes` should work with any path
* Add missing documentation

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@skjnldsv skjnldsv merged commit 51e07c0 into master Aug 18, 2023
9 of 10 checks passed
@skjnldsv skjnldsv deleted the fix-dav-functions branch August 18, 2023 14:36
@skjnldsv skjnldsv mentioned this pull request Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants