Uh oh!
There was an error while loading. Please reload this page.
OCS Share API to appframework - #445
Conversation
mention-bot
commented
Jul 19, 2016
@rullzer, thanks for your PR! By analyzing the annotation information on this pull request, we identified @schiessle, @nickvergessen and @icewind1991 to be potential reviewers |
rullzer
commented
Jul 19, 2016
The thing here is that we can't use all (we can use some) of the standard AppFramework responses. Since here we want to add a message often as well (to not change the output of the API). Should we add OCSNotFoundResponse etc? @BernhardPosselt@LukasReschke@icewind1991@nickvergessen@MorrisJobke |
BernhardPosselt
commented
Jul 19, 2016
Depends really. You could use a trait like https://github.com/owncloud/app-tutorial/blob/master/controller/errors.php#L13 or implement an afterException hook in a middleware that responds to an OCSNotFoundException, you could add a shortcut function, custom response type etc etc :D |
rullzer
commented
Jul 19, 2016
Fair enough. Maybe an OCSMiddleware that lives in core would not be so bad. Then it just catches OCS***Exceptions. |
There's definitely a benefit in adding a type for these well defined cases since it makes it harder to make mistakes. Types and Exceptions are sometimes hard to distinguish and other languages actually only have types (e.g. Result<String, Error> where String is the success case and Error the error case) Ultimately I like the exception approach a little bit more than the custom response because I think its more idiomatic. However both approaches can and should work fine :) |
rullzer
commented
Jul 19, 2016
After thinking about it I think I prefer the exceptions as well. I'll create a PR soonish and let you know. |
3e9d360 to
78f4a8eComparerullzer
commented
Jul 20, 2016
Rebase on #475 once in... |
a4f8e90 to
21a140bComparerullzer
commented
Jul 20, 2016
Needs: #480 |
6ef5ec8 to
e067f73Comparerullzer
commented
Jul 22, 2016
Ok finally time to review. A lot is rewriting the tests. But I think this cleaned up the code alread pretty good. |
| $this->assertFalse($result->succeeded()); | ||
| try { | ||
| $ocs->createShare(); | ||
| $this->fail(); |
MorrisJobke
commented
Jul 25, 2016
rullzer
commented
Jul 25, 2016
@MorrisJobke ah mmm I get that to. Let me check why. |
e067f73 to
c2c58d2CompareMorrisJobke
commented
Jul 30, 2016
Rebased on master. @LukasReschke@rullzer Is the above mentioned issue fixed with this then? |
7c328f0 to
55a4d53Comparerullzer
commented
Jul 30, 2016
@MorrisJobke it is now. |
rullzer
commented
Aug 1, 2016
Ah joy this breaks the intergration tests... because we did not set the header there. |
2b216d4 to
6b64109Comparerullzer
commented
Aug 1, 2016
All fixed. @LukasReschke@schiessle@nickvergessen final review? |
MorrisJobke
commented
Aug 2, 2016
|
6b64109 to
b62510dCompareConflicts resolved. |
| * The getShares function. | ||
| * | ||
| * @NoAdminRequired | ||
| d * |
* This will cleanup the locks after each request * Move check for enabled share api to the middleware
b62510d to
dd9f195CompareMorrisJobke
commented
Aug 5, 2016
Still works 👍 |
LukasReschke
commented
Aug 8, 2016
👍 |
…work OCS Share API to appframework

First OCS API to be ported.
TODO: