Skip to content

Conversation

@rullzer
Copy link
Member

@rullzer rullzer commented Jul 19, 2016

First OCS API to be ported.

TODO:

  • Fix tests
  • Add middleware
  • Add more response types (I don't like those magic arrays retruned)
  • Test middleware
  • Split PR into OCSMiddleware thingy

@rullzer rullzer added the 2. developing Work in progress label Jul 19, 2016
@mention-bot
Copy link

@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
Copy link
Member Author

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?
Other idea's?

@BernhardPosselt @LukasReschke @icewind1991 @nickvergessen @MorrisJobke

@BernhardPosselt
Copy link
Member

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
Copy link
Member Author

rullzer commented Jul 19, 2016

Fair enough.
But I'm more looking for something that we could use in all cases where the OCS API is in use.

Maybe an OCSMiddleware that lives in core would not be so bad. Then it just catches OCS***Exceptions.

@BernhardPosselt
Copy link
Member

BernhardPosselt commented Jul 19, 2016

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
Copy link
Member Author

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.

@rullzer rullzer force-pushed the ocs_share_to_appframework branch from 3e9d360 to 78f4a8e Compare July 20, 2016 13:27
@rullzer
Copy link
Member Author

rullzer commented Jul 20, 2016

Rebase on #475 once in...

@rullzer rullzer force-pushed the ocs_share_to_appframework branch 2 times, most recently from a4f8e90 to 21a140b Compare July 20, 2016 19:49
@rullzer
Copy link
Member Author

rullzer commented Jul 20, 2016

Needs: #480

@rullzer rullzer force-pushed the ocs_share_to_appframework branch 7 times, most recently from 6ef5ec8 to e067f73 Compare July 22, 2016 14:10
@rullzer rullzer added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jul 22, 2016
@rullzer rullzer added this to the Nextcloud 11.0 milestone Jul 22, 2016
@rullzer
Copy link
Member Author

rullzer 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.

CC: @schiessle @nickvergessen @MorrisJobke @LukasReschke

$this->assertFalse($result->succeeded());
try {
$ocs->createShare();
$this->fail();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that one 👍

@MorrisJobke
Copy link
Member

I get following when opening the share sidebar and it logs me out, because it thinks the session has timed out:

bildschirmfoto 2016-07-25 um 09 40 19

@rullzer rullzer added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Jul 25, 2016
@rullzer
Copy link
Member Author

rullzer commented Jul 25, 2016

@MorrisJobke ah mmm I get that to. Let me check why.

@rullzer rullzer force-pushed the ocs_share_to_appframework branch from e067f73 to c2c58d2 Compare July 25, 2016 19:19
@MorrisJobke
Copy link
Member

Rebased on master.

@LukasReschke @rullzer Is the above mentioned issue fixed with this then?

@rullzer rullzer force-pushed the ocs_share_to_appframework branch 2 times, most recently from 7c328f0 to 55a4d53 Compare July 30, 2016 11:23
@rullzer
Copy link
Member Author

rullzer commented Jul 30, 2016

@MorrisJobke it is now.
@LukasReschke any other remarks?

@rullzer rullzer added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jul 30, 2016
@rullzer
Copy link
Member Author

rullzer commented Aug 1, 2016

Ah joy this breaks the intergration tests... because we did not set the header there.

@rullzer rullzer force-pushed the ocs_share_to_appframework branch 2 times, most recently from 2b216d4 to 6b64109 Compare August 1, 2016 12:38
@rullzer
Copy link
Member Author

rullzer commented Aug 1, 2016

All fixed.

@LukasReschke @schiessle @nickvergessen final review?

@MorrisJobke
Copy link
Member

This branch has conflicts that must be resolved

@rullzer

@rullzer rullzer force-pushed the ocs_share_to_appframework branch from 6b64109 to b62510d Compare August 3, 2016 08:17
@rullzer
Copy link
Member Author

rullzer commented Aug 3, 2016

Conflicts resolved.
Review time!!!!

* The getShares function.
*
* @NoAdminRequired
d *
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😱

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@rullzer rullzer force-pushed the ocs_share_to_appframework branch from b62510d to dd9f195 Compare August 5, 2016 12:17
@MorrisJobke
Copy link
Member

Still works 👍

@LukasReschke
Copy link
Member

👍

@LukasReschke LukasReschke merged commit 70eef2a into master Aug 8, 2016
@LukasReschke LukasReschke deleted the ocs_share_to_appframework branch August 8, 2016 13:00
GitHubUser4234 pushed a commit to GitHubUser4234/server that referenced this pull request Aug 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants