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 CalDAV blocking and modernize circles API usage #3500

Merged
merged 2 commits into from
Jan 11, 2022
Merged

Conversation

juliusknorr
Copy link
Member

  • Avoid blocking calendar access if something goes wrong while fetching deck entries
  • Move any circles API usage to internal service and make use of new circles API to get the list of circles for a user

@juliusknorr
Copy link
Member Author

@ArtificialOwl

return \OCA\Circles\Api\v1\Circles::detailsCircle($circleId, true);
is still using the old API, would the following work fine for replacing that?

		// Enforce current user condition since we always want the full list of members
		/** @var CirclesManager $circlesManager */
		$circlesManager = \OC::$server->get(CirclesManager::class);
		$circlesManager->startSuperSession();
		return $circlesManager->getCircle($circleId);

@ArtificialOwl
Copy link
Member

@ArtificialOwl

return \OCA\Circles\Api\v1\Circles::detailsCircle($circleId, true);

is still using the old API, would the following work fine for replacing that?

		// Enforce current user condition since we always want the full list of members
		/** @var CirclesManager $circlesManager */
		$circlesManager = \OC::$server->get(CirclesManager::class);
		$circlesManager->startSuperSession();
		return $circlesManager->getCircle($circleId);

It should work, however you need to be sure that the params in getCircle(string $circleId) are not fed by a user:

public function getCircle($circleId) {

@ArtificialOwl
Copy link
Member

not tested, but code looks good.

The only comment I have is that after migration of CirclesService::getCircle() to the new API, the exception returned by the new API (if Circle is out of reach) will be managed by a catch (Throwable)

… deck entries

Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
@juliusknorr juliusknorr requested a review from julien-nc January 4, 2022 10:36
@juliusknorr juliusknorr merged commit fc58528 into master Jan 11, 2022
@juliusknorr juliusknorr deleted the bugfix/3312 branch January 11, 2022 08:26
@juliusknorr
Copy link
Member Author

/backport to stable23

@juliusknorr
Copy link
Member Author

/backport to stable22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

External CalDAV access no longer works after upgrade to 1.4.4
2 participants