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

iCal Meeting Entries (Event) have a random UniqueIdentifier and therefore "flicker" in Calendar Apps #517

Open
tha80 opened this issue Mar 25, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@tha80
Copy link

tha80 commented Mar 25, 2024

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

  1. Create a new Meeting
  2. Subscribe to the calendar (Apple Calendar App on Mac and iPhone are at least showing the "flicker")
  3. 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.

@tha80
Copy link
Author

tha80 commented Mar 25, 2024

Ah, and thanks for providing such a great tool! I really enjoy using it! Keep up the great work guys!

@holema
Copy link
Contributor

holema commented Mar 25, 2024

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.

@tha80
Copy link
Author

tha80 commented Mar 25, 2024

@holema

basically it looks like this:
iCalBugCut

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.

@holema
Copy link
Contributor

holema commented Apr 23, 2024

@tha80 This will be fixed in the next release

@holema holema added the bug Something isn't working label Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants