Skip to content

Commit

Permalink
fix(dav): fix event birthday alarms not being updated
Browse files Browse the repository at this point in the history
In #33251 the default offset for
a birthday event alarm was changed to 9AM on the day of the event.

However the birthdayEvenChanged method did not account for alarm
changes, so it was never propagated to existing birthday events, which
were kept on midnight.

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
  • Loading branch information
tcitworld committed Oct 2, 2023
1 parent 0cb489d commit 24e6ef5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion apps/dav/lib/CalDAV/BirthdayService.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,11 @@ public function syncUser(string $user):void {
}

/**
* The birthday event is considered changed if either
* - the start date has changed
* - the title has changed
* - the time for the alarm has changed
*
* @param string $existingCalendarData
* @param VCalendar $newCalendarData
* @return bool
Expand All @@ -331,7 +336,8 @@ public function birthdayEvenChanged(string $existingCalendarData,

return (
$newCalendarData->VEVENT->DTSTART->getValue() !== $existingBirthday->VEVENT->DTSTART->getValue() ||
$newCalendarData->VEVENT->SUMMARY->getValue() !== $existingBirthday->VEVENT->SUMMARY->getValue()
$newCalendarData->VEVENT->SUMMARY->getValue() !== $existingBirthday->VEVENT->SUMMARY->getValue() ||

Check notice

Code scanning / Psalm

PossiblyNullPropertyFetch Note

Cannot get property on possibly null variable $newCalendarData->VEVENT of type Sabre\VObject\Property|null

Check notice

Code scanning / Psalm

UndefinedPropertyFetch Note

Instance property Sabre\VObject\Property::$SUMMARY is not defined

Check notice

Code scanning / Psalm

PossiblyNullReference Note

Cannot call method getValue on possibly null value

Check notice

Code scanning / Psalm

PossiblyNullPropertyFetch Note

Cannot get property on possibly null variable $existingBirthday->VEVENT of type Sabre\VObject\Property|null

Check notice

Code scanning / Psalm

UndefinedPropertyFetch Note

Instance property Sabre\VObject\Property::$SUMMARY is not defined

Check notice

Code scanning / Psalm

PossiblyNullReference Note

Cannot call method getValue on possibly null value
($newCalendarData->VEVENT->VALARM && $existingBirthday->VEVENT->VALARM && $newCalendarData->VEVENT->VALARM->TRIGGER->getValue() !== $existingBirthday->VEVENT->VALARM->TRIGGER->getValue())

Check failure on line 340 in apps/dav/lib/CalDAV/BirthdayService.php

View workflow job for this annotation

GitHub Actions / static-code-analysis

UndefinedPropertyFetch

apps/dav/lib/CalDAV/BirthdayService.php:340:5: UndefinedPropertyFetch: Instance property Sabre\VObject\Property::$VALARM is not defined (see https://psalm.dev/039)

Check failure on line 340 in apps/dav/lib/CalDAV/BirthdayService.php

View workflow job for this annotation

GitHub Actions / static-code-analysis

UndefinedPropertyFetch

apps/dav/lib/CalDAV/BirthdayService.php:340:41: UndefinedPropertyFetch: Instance property Sabre\VObject\Property::$VALARM is not defined (see https://psalm.dev/039)

Check failure

Code scanning / Psalm

UndefinedPropertyFetch Error

Instance property Sabre\VObject\Property::$VALARM is not defined

Check failure

Code scanning / Psalm

UndefinedPropertyFetch Error

Instance property Sabre\VObject\Property::$VALARM is not defined

Check notice

Code scanning / Psalm

PossiblyNullPropertyFetch Note

Cannot get property on possibly null variable $newCalendarData->VEVENT of type Sabre\VObject\Property|null

Check notice

Code scanning / Psalm

PossiblyNullPropertyFetch Note

Cannot get property on possibly null variable $existingBirthday->VEVENT of type Sabre\VObject\Property|null
);
}

Expand Down

0 comments on commit 24e6ef5

Please sign in to comment.