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

feat(dav): Directly access shared calendars by URI #36681

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tcitworld
Copy link
Member

Each time we access a shared calendar details (with getChild), this loads every user's calendars and iterates until the correct one is found. Now we lookup from the shared calendars which ones has the correct URI, just iterating on the possible shares (for instance a calendar can be shared directly through user-to-user share or through user-to-group share).

Didn't mesure properly the performance benefits, but should be really nice with many shared calendars.

Follow-up to #33608

TODO

  • Add some tests for this new method

Checklist

Each time we access a shared calendar details (with getChild), this loads every user's calendars and iterates until the correct one is found.
Now we lookup from the shared calendars which ones has the correct URI, just iterating on the possible shares (for instance a calendar can be shared directly through user-to-user share or through user-to-group share).

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
@tcitworld tcitworld added 2. developing Work in progress performance 🚀 feature: caldav Related to CalDAV internals labels Feb 13, 2023
@tcitworld tcitworld requested a review from a team February 13, 2023 08:32
@tcitworld tcitworld requested review from ArtificialOwl, icewind1991 and blizzz and removed request for a team February 13, 2023 08:32
}

$readOnly = (int)$row['access'] === Backend::ACCESS_READ;
if (isset($calendars[$row['id']])) {

Check failure

Code scanning / Psalm

UndefinedVariable

Cannot find referenced variable $calendars
}

// Fixes for shared calendars
[, $name] = Uri\split($row['principaluri']);

Check failure

Code scanning / Psalm

UndefinedFunction

Function Sabre\Uri\split does not exist
$readOnlyPropertyName => $readOnly,
];
}
$calendar = $this->rowToCalendar($row, $calendar);

Check notice

Code scanning / Psalm

PossiblyUndefinedVariable

Possibly undefined variable $row, first seen on line 694
$readOnlyPropertyName => $readOnly,
];
}
$calendar = $this->rowToCalendar($row, $calendar);

Check notice

Code scanning / Psalm

PossiblyNullArgument

Argument 2 of OCA\DAV\CalDAV\CalDavBackend::rowToCalendar cannot be null, possibly null value provided
@blizzz blizzz added this to the Nextcloud 29 milestone Nov 23, 2023
This was referenced Mar 12, 2024
@Altahrim Altahrim mentioned this pull request Mar 20, 2024
@skjnldsv skjnldsv modified the milestones: Nextcloud 29, Nextcloud 30 Mar 28, 2024
@skjnldsv skjnldsv modified the milestones: Nextcloud 30, Nextcloud 31 Aug 14, 2024
@skjnldsv skjnldsv closed this Aug 14, 2024
@skjnldsv skjnldsv removed this from the Nextcloud 31 milestone Aug 14, 2024
@skjnldsv skjnldsv deleted the direct-access-shared-calendar branch August 30, 2024 07:30
@tcitworld tcitworld restored the direct-access-shared-calendar branch September 9, 2024 06:48
@tcitworld tcitworld reopened this Sep 9, 2024
@blizzz blizzz removed their request for review September 11, 2024 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Work in progress feature: caldav Related to CalDAV internals performance 🚀
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants