chrisblakley / Daylight-Calendar-ICS

Daylight Calendar is a dynamically generated .ics calendar that you can host and subscribe to in Google Calendar, iCal, or other calendar software.
https://gearside.com/google-daylight-calendar/
GNU General Public License v2.0
43 stars 6 forks source link

Daylight calendar now displaying 3-6 events per day #18

Closed elinaru closed 3 months ago

elinaru commented 3 months ago

Starting today, the calendar has three to six events per day in the calendar. Each event appears to be a near duplicate.

For instance, today's (Aug 6, 2024) event "13h 57m (58.1%) [83.2 Percentile]." is duplicated six times with the only difference being this line in the description text:

[Last Updated: Monday, August 5, 2024, 4:01pm] [Last Updated: Monday, August 5, 2024, 10:01pm] [Last Updated: Tuesday, August 6, 2024, 12:01pm] [Last Updated: Tuesday, August 6, 2024, 5:01am] [Last Updated: Tuesday, August 6, 2024, 1:01pm] [Last Updated: Monday, August 5, 2024, 11:01pm]

Can anything be done to one again display only one event per day?
Thanks! Elina

chrisblakley commented 3 months ago

I noticed this as well today. I have another calendar that syncs from a different endpoint and it is also duplicated.

Just to note this for future reference, here's what it looks like: Screenshot 2024-08-06 at 5 27 09 PM

I think this may be a temporary issue with Google Calendar because there have been no changes to the code between yesterday and today when it began happening.

For now, I'd recommend hiding the calendar and let's monitor the issue to see if it gets resolved on their end. I am not sure what I'd be able to do in the code as there are no duplicates locally.

Thanks for confirming the issue is happening to others, too!

elinaru commented 3 months ago

Hi Chris,

Thanks for the quick response! Hopefully an update on Google side solves the issue.

Thanks again, Elina

On Tue, Aug 6, 2024 at 2:27 PM Chris Blakley @.***> wrote:

I noticed this as well today. I have another calendar that syncs from a different endpoint and it is also duplicated.

I think this may be a temporary issue with Google Calendar because there have been no changes to the code between yesterday and today when it began happening.

For now, I'd recommend hiding the calendar and let's monitor the issue to see if it gets resolved on their end. I am not sure what I'd be able to do in the code as there are no duplicates locally.

Thanks for confirming the issue is happening to others, too!

— Reply to this email directly, view it on GitHub https://github.com/chrisblakley/Daylight-Calendar-ICS/issues/18#issuecomment-2272180975, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRLBZ5YBWFUPNZPXUOYXODZQE5SNAVCNFSM6AAAAABMDEEYTGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZSGE4DAOJXGU . You are receiving this because you authored the thread.Message ID: @.***>

crpAnderson commented 3 months ago

I'm also seeing this behavior

chrisblakley commented 3 months ago

Can anyone confirm if this is happening to other subscribed calendars via URL as well or just this one?

crpAnderson commented 3 months ago

I am using a subscribed calendar but I see the same behavior in the standalone URL http://gearside.com/calendars/daylight.php?lat=44.8&lng=-93.14&gmt=-6 image Public URL to this calendar https://calendar.google.com/calendar/embed?src=7pfpjutc95omse7eg7bltks4k9q8ospl%40import.calendar.google.com&ctz=America%2FChicago

chrisblakley commented 3 months ago

Thanks– I'm curious if other different calendars that are subscribed in the same was as this Daylight calendar are showing the same problems. I have another completely different calendar that Google Calendar is duplicating too, but it is also from the same domain so I don't know if that indicates a global problem or something local to this server.

If I delete and re-add the Daylight calendar, it goes back to just a single event for each day, so the duplication problem does not appear to be with the ICS file that it generates– it implies that Google Calendar isn't swapping the old for the new properly. I'll see if this re-adding of the calendar starts duplicating again or not.

Hopefully we can get this figured out soon!

crpAnderson commented 3 months ago

When I remove the calendar and re-subscribe I still get the duplication problem.

coman49 commented 3 months ago

Same issue here, noticed it a few days ago for me. I have other calendars I'm subscribed to in the same way (via URL) and they don't have this issue. If I remove the calendar and then re-add it with something like &nocache at the end of the URL then duplicates disappear at first but sometime later they reappear again. Also tried turning offline off but didn't help. Duplication is not consistent, for example right now some days show normal single entry, some days show 2 duplicate entries, some show 3 identical entries. And as somebody else mentioned, the only difference between the entries is this line - "[Last Updated: Wednesday, August 7, 2024, 11:40am] ".

chrisblakley commented 3 months ago

Thanks for the additional info. I'll continue to look into it!

chrisblakley commented 3 months ago

I made an adjustment to the "UID" value of each event to try to be unique and consistent between when Google Calendar retrieves new data.

I'll be testing this by re-adding the calendar (with a query string to bust the cache) and waiting for Google to update it over the course of a day or two. Anyone else is welcome to give it a try as well. https://gearside.com/calendars/daylight.php?asdzxcvf

If this doesn't work I'll continue reviewing it!

chrisblakley commented 3 months ago

This latest update seems promising so far– Google has updated the calendar a few times and have seen no duplicates.

Unfortunately, it does not appear that the old calendar is automatically removing duplicates, so the solution may require us to re-add the calendar to resolve this.

Will keep an eye on it still.

bobk26 commented 3 months ago

This latest update seems promising so far– Google has updated the calendar a few times and have seen no duplicates.

Unfortunately, it does not appear that the old calendar is automatically removing duplicates, so the solution may require us to re-add the calendar to resolve this.

Will keep an eye on it still.

I'm encountering this duplication issue, and I just tried removing and re-adding the calendar, and it had no effect. Perhaps the Google fix hasn't been pushed live yet?

chrisblakley commented 3 months ago

Google Calendar does cache the URLs, so if you used the same URL as previous it might not actually retrieve the new code (if you're using the gearside.com endpoint). Try adding a random query string to the end like ?asdfwer3751 if you haven't already (and make sure the new random query string is different than one you've previously used).

Once we determine that new code is working then I'll push the commit to GitHub here.

coman49 commented 3 months ago

It's working for me so far, no duplicates, it's been about half a day. Make sure to add "&nocache" at the end of the URL when re-adding it back.

bobk26 commented 3 months ago

It's working for me so far, no duplicates, it's been about half a day. Make sure to add "&nocache" at the end of the URL when re-adding it back.

The nocache fixed it, thank you!

Do I need to keep nocache in the url forever? I don't want to use resources unnecessarily. Thanks!

chrisblakley commented 3 months ago

I would leave it on for as long as you want to use this calendar– and if in the future anything else comes up where we need to publish new code you can update the nocache query string again to get fresh data.

It does not use any additional resources, so nothing to worry about there!

Glad to hear this worked! For anyone subscribing to the gearside.com endpoint, it looks like this fix is good so feel free to update your calendar URLs. Anyone using the PHP code itself, I will push a commit to this repo sometime this weekend!

chrisblakley commented 3 months ago

Closing as this fix has been committed. If for some reason it still occurs feel free to continue the discussion here or we can re-open if needed. Any issues that are similar but not directly related to duplicate events feel free to create a new issue. Thanks everyone!