-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Sabre Update to 2.1 #14151
Sabre Update to 2.1 #14151
Conversation
@@ -1,4 +1,6 @@ | |||
<?php | |||
namespace OC\Connector\Sabre; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be fine to kill the connector from the namespace and folder structure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Next time maybe, there's already enough to do to makes this work 😉
I'll namespacize the classes I touch though.
|
|
|
It looks like the methods "httpGet", etc have to be moved to a plugin now. |
|
Oh, that is nice:
|
|
Looks like the "beforeGetProperties" approach isn't valid any more. Need to switch to another technique, maybe listenning to the "propFind" even on nodes.
|
|
$this->server->subscribeEvent('beforeGetProperties', array($this, 'beforeGetProperties')); | ||
$this->server->subscribeEvent('afterBind', array($this, 'sendFileIdHeader')); | ||
$this->server->subscribeEvent('afterWriteContent', array($this, 'sendFileIdHeader')); | ||
$this->server->on('beforeGetProperties', array($this, 'beforeGetProperties')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that beforeGetProperties
has been removed as of version 2.0. There's a new event called propFind
that does what you need, and it's documented here:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the hint, already found it and implementing it now.
How about "beforeGetPropertiesForPath" ? That one was convenient for prefeteching data for multiple nodes in a go. Is that still possible ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the idea here was that we simply still emit a propFind
event. This event has an argument that's an instance of Sabre\DAV\PropFind
. That object will have a depth property set to 1, which means that you'll need to prefetch the data. At least, that was the intention. I didn't test this myself!
|
@@ -26,7 +26,7 @@ | |||
* This class overrides \Sabre\VObject\Property::serialize() to not | |||
* double escape commas and semi-colons in compound properties. | |||
*/ | |||
class CompoundProperty extends \Sabre\VObject\Property\Compound { | |||
class CompoundProperty extends \Sabre\VObject\Property\Text { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This existed to work around issues with vobject 2.1. These issues should no longer exist, so should be removed.
|
3f6700e
to
c6ca07c
Compare
I'm pretty sure you can integrate scrutinizer properly with github these days, so the issue comments are no longer needed. They're a bit useless! |
Same with jenkins! So noisy! |
The jenkins github integration does not allow multiple commit statuses. Maybe one day ..... |
Very awesome to see that this is a 'negative diff' so far ;) More lines removed than added. |
|
|
@evert if I implement the custom properties logic in a plugin (a backend of PropertyStorage), should I remove "implement IProperties" from the Node then ? |
|
Keeping it is optional. The new property system is designed so multiple separate plugins can 'opt in' to handling storing or retrieval of certain properties. If you no longer have a need for IProperties in nodes, you can remove it. |
@DeepDiver1975 I will not try and refactor the chunking into plugins right now to reduce the risk of regressions. I think we anyway need to rethink the way we do chunking, maybe send headers instead of using magic file names that need to be parsed. (I tried rewriting the URL in a beforeMethod but it messes up other things, so no easy fix here) |
I'll continue tomorrow .... @evert Many thanks for your support on this! Much appreciated! |
well - the errors as of above and no longer reproducible:
|
All unit tests are successfully executed now as well deepdiver@alien:~/Development/ownCloud/core [update-sabre2.1]$ litmus -k https://localhost/oc/core/remote.php/webdav/ admin admin
-> running `basic':
0. init.................. pass
1. begin................. pass
2. options............... WARNING: server does not claim Class 2 compliance
...................... pass (with 1 warning)
3. put_get............... pass
4. put_get_utf8_segment.. pass
5. put_no_parent......... pass
6. mkcol_over_plain...... pass
7. delete................ pass
8. delete_null........... pass
9. delete_fragment....... pass
10. mkcol................. pass
11. mkcol_again........... pass
12. delete_coll........... pass
13. mkcol_no_parent....... pass
14. mkcol_with_body....... pass
15. finish................ pass
<- summary for `basic': of 16 tests run: 16 passed, 0 failed. 100.0%
-> 1 warning was issued.
-> running `copymove':
0. init.................. pass
1. begin................. pass
2. copy_init............. pass
3. copy_simple........... pass
4. copy_overwrite........ pass
5. copy_nodestcoll....... pass
6. copy_cleanup.......... pass
7. copy_coll............. pass
8. copy_shallow.......... pass
9. move.................. pass
10. move_coll............. pass
11. move_cleanup.......... pass
12. finish................ pass
<- summary for `copymove': of 13 tests run: 13 passed, 0 failed. 100.0%
-> running `props':
0. init.................. pass
1. begin................. pass
2. propfind_invalid...... pass
3. propfind_invalid2..... pass
4. propfind_d0........... pass
5. propinit.............. pass
6. propset............... pass
7. propget............... pass
8. propextended.......... pass
9. propmove.............. pass
10. propget............... pass
11. propdeletes........... pass
12. propget............... pass
13. propreplace........... pass
14. propget............... pass
15. propnullns............ pass
16. propget............... pass
17. prophighunicode....... pass
18. propget............... pass
19. propremoveset......... pass
20. propget............... pass
21. propsetremove......... pass
22. propget............... pass
23. propvalnspace......... pass
24. propwformed........... pass
25. propinit.............. pass
26. propmanyns............ pass
27. propget............... pass
28. propcleanup........... pass
29. finish................ pass
<- summary for `props': of 30 tests run: 30 passed, 0 failed. 100.0%
-> running `locks':
0. init.................. pass
1. begin................. pass
2. options............... WARNING: server does not claim Class 2 compliance
...................... pass (with 1 warning)
3. precond............... SKIPPED (locking tests skipped,
server does not claim Class 2 compliance)
-> 1 test was skipped.
<- summary for `locks': of 3 tests run: 3 passed, 0 failed. 100.0%
-> 1 warning was issued.
-> running `http':
0. init.................. pass
1. begin................. pass
2. expect100............. SKIPPED (skipping for SSL server)
3. finish................ pass
-> 1 test was skipped.
<- summary for `http': of 3 tests run: 3 passed, 0 failed. 100.0% |
@PVince81 from my pov this is ready to go - anything missing? |
Reasoning: - a WebDAV server is not required to implement locking support - WebDAV Locking is know to break the sync algorithm - the current lock implementation is known to be broken (locks are not moved if a file is moved, locks on shared files don't work)
46b6fc6
to
b3de86d
Compare
I hereby agree with your commit that removes the locks 👍 |
Jenkins PR: #14483 |
The inspection completed: 25 new issues, 74 updated code elements |
Refer to this link for build results (access rights to CI server needed): |
👍 |
Hi guys:
|
Sure thing - but we need to go ahead as a hell of other tasks depend on this change.
Sure - but I prefer to lock a file the right way and not that crappy way we do today where we - in some case - pretend to lock but we are actually not locking at all. |
Does litmus do concurrency tests ? If not I don't see how a race condition could happen. Ideally the "new" locking (if ever) should be based on file id for better accuracy even with shared files, but even then it requires stable file ids first. |
no the tests are executed sequentially |
I actually think that webdav locks are not really useful, so I was considering writing an alternative locks plugin that pretends to support locking, but doesn't actually do anything and requires no storage. Clients really ought to be using ETags and such instead of doing locking. |
From my personal pov it highly depends on the workflow - with locking changes can be prevented before they actually did take place. |
The problem with locks and how clients generally implement it, is that they only do the LOCK moments before they do the actual PUT (or other operation) and then do an UNLOCK right after. This behavior has no benefits over using etags and if headers. For locks to be useful, they really need to be controlled by the user before work starts and unlocked after completion, |
This is indeed the workflow I have in mind - 🙊 this is how M$ Office is doing it afaik |
As discussed in #14151, we missed to add this to the `files_sharing` S2S public WebDAV backend though.
As discussed in owncloud#14151, we missed to add this to the `files_sharing` S2S public WebDAV backend though.
TODOs
Regression testing