jitsi-admin
jitsi-admin copied to clipboard
iCal Meeting Entries (Event) have a random UniqueIdentifier and therefore "flicker" in Calendar Apps
Describe the bug Because the iCal Meeting Entries (Events) have a random UniqueIdentifier (UID) in some calendar applications there is some form of flicker during the update.
To Reproduce
- Create a new Meeting
- Subscribe to the calendar (Apple Calendar App on Mac and iPhone are at least showing the "flicker")
- Wait for the calendar to refresh to see (for a few seconds) duplicate of all entries (alternatively reopen the calendar seems to trigger a refresh)
Alternate way: Use curl to fetch the iCal URL and look at the UID field of the first event. Fetch the URL again to see a different UID.
Branch or Version you using I cloned git a few days ago.
Expected behavior UniqueIdentifiers should be stable in iCal Events
Additional context I have fixed that on my system by generating a UID based on the URL of the meeting:
diff --git a/src/Service/IcalService.php b/src/Service/IcalService.php
index 109f2e02..455480ad 100644
--- a/src/Service/IcalService.php
+++ b/src/Service/IcalService.php
@@ -16,6 +16,7 @@ use Eluceo\iCal\Domain\ValueObject\Alarm\RelativeTrigger;
use Eluceo\iCal\Domain\ValueObject\DateTime;
use Eluceo\iCal\Domain\ValueObject\Location;
use Eluceo\iCal\Domain\ValueObject\TimeSpan;
+use Eluceo\iCal\Domain\ValueObject\UniqueIdentifier;
use Eluceo\iCal\Presentation\Factory\CalendarFactory;
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
use Symfony\Contracts\Cache\ItemInterface;
@@ -102,8 +103,9 @@ class IcalService
)
);
foreach ($this->rooms as $event) {
- $vEvent = new Event();
$url = $this->userService->generateUrl($event, $user);
+ $uid = hash('sha256', $url);
+ $vEvent = new Event(new UniqueIdentifier($uid));
$vEvent
->setOccurrence(
new TimeSpan(
For me this fixes the flickering. I am not sure if this is the perfect solutions though, because if an event is changed, as far as I understand it the URL will be different and therefore also the UID of the iCal Event. But at least it only happens once per change for only one event (and not for all). So, even in case this might not be perfect, it's way better than without generating the UID based on the URL.
Ah, and thanks for providing such a great tool! I really enjoy using it! Keep up the great work guys!
Hello @tha80,
Thank you for providing such a great issue description. It would be fantastic if we could receive such good descriptions every time.
I will take a look at it. Normally, the UID should always be the same, but I will investigate further and provide you with feedback afterward.
The problem is, that we are all not using an apple product so we need your feedback in this case.
@holema
basically it looks like this:
I guess the calendar app directly shows the "new" events after fetching the ical file, leading to the duplicates visible in the app. And after some time it realizes that the "old" events are not in the file anymore and therefore those disappear in the app. Not sure why this not happens in one operation (and then would be invisible), but yeah, that's how it is :)
Most of the time it's happening quicker than visible in the example above, but it's always visible and for me quite disturbing (especially because I normally have quite a lot more entries in my calendar).
In addition I also noticed that when I add a reminder to one of those events, that it will disappears after refetching (mostly likely also because of the UID changed).
So I guess that even when only apple products might be showing this "flicker", other apps might also be affected by things like "forgetting" custom alarms and so on.
@tha80 This will be fixed in the next release