Skip to content

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 <[email protected]>
@tcitworld tcitworld added 2. developing Work in progress performance 🚀 feature: caldav Related to CalDAV internals labels Feb 13, 2023
@tcitworld tcitworld requested review from a team, ArtificialOwl, blizzz and icewind1991 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
@skjnldsv skjnldsv added this to the Nextcloud 32 milestone Jan 30, 2025
@skjnldsv skjnldsv modified the milestones: Nextcloud 32, Nextcloud 33 Sep 28, 2025
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.

4 participants