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

recurrent events now break plugin completely. What has changed? #96

Closed
seatrout opened this issue Dec 31, 2023 · 27 comments
Closed

recurrent events now break plugin completely. What has changed? #96

seatrout opened this issue Dec 31, 2023 · 27 comments
Assignees
Labels
bug Something isn't working

Comments

@seatrout
Copy link

For the last five days, the plugin has been horrible broken: it finds huge numbers of recurrent events from past years ands spews them into my daily note, complaining about "Invalid date" — this with a template that was working perfectly well before Christmas.

Using this template fragment (adjusted to fit the way I name my diaries):

<%*  
var events = await app.plugins.getPlugin('ics').getEvents(moment(tp.file.title,'DD MMMM YYYY - dddd'));  
if (events.length) {  
    tR+= `>[!Danger]- Today's Schedule\n`  
    events.sort((a,b) => a.utime - b.utime).forEach((e) => {  
        const calendar = e.icsName.replace(" ","-");  
        const callUrl = e.callUrl? ` [${e.callType}](${e.callUrl})` : '';  
        const location = e.location? ` 📍 *(${e.location})*` : '';  
        tR+=`- [ ] ${e.time}-${e.endTime} **${e.summary}**${location}${callUrl} #${calendar}\n`  
        if (e.description) {  
            const inlineDescription = e.description.replace(/(?:\r\n|\r|\n)/g," ").replace(/\s{2,}/g," ");  
            tR+=`    - ${inlineDescription}\n`  
        }  
    })  
}  
%>  


I get hundreds of lines complaining of "Invalid date" in recurring events that have long since passed, and don't in any case affect today:

like this:

# testing ICS
- [ ] Invalid date-Invalid date **Mary Heley** 📍 *(XXXXXX)* #seatrout
  {Repeat 17 times}

- [ ] Invalid date-Invalid date **Renew prescription** #seatrout
- [ ] {repeat 164 times}

- [ ] Invalid date-Invalid date **RMC editorial meeting** 📍 *(zoom see below)* #seatrout
 { repeat 12 times} 
 
 ... and so on, some of these errors going back *20 years*

I have tried this with a conventionally named date template too: it is clearly something in the handling of recurrent events in the plugin.

@seatrout
Copy link
Author

seatrout commented Dec 31, 2023

Looking at the console, there are 983 messages from the plugin (no errors) — of which this is a typical fragment :

Cloned event: Object
plugin:ics:22 Found a recurring event to clone:  Ann the cleaner  on  Invalid Date at  Wed Jan 12 2022 11:30:00 GMT+0000 (Greenwich Mean Time)
plugin:ics:22 RRULE origOptions: Object
plugin:ics:22 Event rrule.origOptions.tzid: Europe/London
plugin:ics:22 Cloned event: Object
plugin:ics:22 Found a recurring event to clone:  Ann the cleaner  on  Invalid Date at  Wed Jan 12 2022 11:30:00 GMT+0000 (Greenwich Mean Time)
plugin:ics:22 RRULE origOptions: Object
plugin:ics:22 Event rrule.origOptions.tzid: Europe/London
plugin:ics:22 Cloned event: 

A screenshot of the console log:

image

@muness
Copy link
Member

muness commented Dec 31, 2023

Thanks for the report. When I moved the repo I updated the node-ical package. That likely broke the recurring rule parsing.

My apologies. You can try the previous release of you'd like while I revert the dependency upgrade in the next few hours.

@muness muness added the bug Something isn't working label Dec 31, 2023
@muness muness self-assigned this Dec 31, 2023
@muness
Copy link
Member

muness commented Dec 31, 2023

Reverting back to 0.16.1

@muness
Copy link
Member

muness commented Dec 31, 2023

@seatrout - what calendar providers are you using? I'm trying to reproduce the issue and I don't see the issue with Google Calendar feeds.

@muness
Copy link
Member

muness commented Dec 31, 2023

I tried O365 calendars too without being able to reproduce.

From looking at the provided screenshot I see APPLE-TRAVEL-ADVISORY-BEHAVIOR which I believe is an Apple specific calendar entry, will see if I can create an iCloud hosted calendar.

@seatrout
Copy link
Author

I'm using Google. I don't know where the Apple thing came from, except that one of these Google calendars is shared with my wife, who does keep an Apple calendar.

@seatrout
Copy link
Author

The "RMC Editorial meetings" may also be shared with people who use Apple providers. But most of the calendars referenced in the file are Google, even if they are shared.

@seatrout
Copy link
Author

Do shared calendars put out a different ICS feed/ That seems very unlikely to me, but what would I know?

@muness
Copy link
Member

muness commented Dec 31, 2023

You are correct, they should not be any different.

@seatrout - can you try the release before the update? https://github.com/cloud-atlas-ai/obsidian-ics/releases/tag/1.5.0 . Replace main.js in your <vault>/.obsidian/plugins/ics with the one at that release and then import the day's events again. Thanks!

@muness
Copy link
Member

muness commented Dec 31, 2023

@seatrout - can you try the release before the update? https://github.com/cloud-atlas-ai/obsidian-ics/releases/tag/1.5.0 . Replace main.js in your <vault>/.obsidian/plugins/ics with the one at that release and then import the day's events again. Thanks!

Oh, and you'll need to restart Obsidian before trying to re-import

@seatrout
Copy link
Author

Yay! That works again. Thank you — what exactly changed to break things?
Anyway, thank you so much for fixing this so quickly.

@muness
Copy link
Member

muness commented Dec 31, 2023

Yay! That works again. Thank you — what exactly changed to break things? Anyway, thank you so much for fixing this so quickly.

I haven't changed anything yet. ;)

1.5.0 works for you?

@seatrout
Copy link
Author

Just to confirm: 1.50 works again, yes.
(That Obsidian is taking minutes to reload — presumably to rebuild — its cache files when restarted is not your problem)

@seatrout
Copy link
Author

So it was the update in node-ical which broke this?

@muness
Copy link
Member

muness commented Dec 31, 2023

So it was the update in node-ical which broke this?

I believe so, which in turn pulled in changes to rrule.

I'd rather not revert to 0.16.1 as it's showing a dependency on a vulnerable axios:

node_modules/axios
  node-ical  0.14.0 - 0.16.1
  Depends on vulnerable versions of axios
  node_modules/node-ical

I am exploring other options now, would love help testing once I get an idea...

@muness
Copy link
Member

muness commented Dec 31, 2023

k, looks like I can lock rrule to a previous version even while updating node-ical... Testing that locally.

@seatrout
Copy link
Author

Happy to help test this
But when I look at these complications and dependencies I am so glad I am not a developer.

@muness
Copy link
Member

muness commented Dec 31, 2023

@seatrout , https://github.com/cloud-atlas-ai/obsidian-ics/releases/tag/1.5.1-lockrrule3 works for me locally (but I never suffered the breakage). In this release I keep the update to node-ical but lock rrule to 2.6.6.

Hoping this no longer shows the erroneous recurring events for you when you try it. You'll replace the main.js again, restart and then try again.

Thanks!

@muness
Copy link
Member

muness commented Dec 31, 2023

One more https://github.com/cloud-atlas-ai/obsidian-ics/releases/tag/1.5.1-lockrrule4 - this uses the last rrule 2.6.8 release on the 2.6 version.

@muness
Copy link
Member

muness commented Dec 31, 2023

But when I look at these complications and dependencies I am so glad I am not a developer.

It's all part of the cost of being able to make computers do all the things they do. ;)

@muness
Copy link
Member

muness commented Dec 31, 2023

Actually, I realized that the above build still had the older axios dependency.

@seatrout : Please let me know if the latest, https://github.com/cloud-atlas-ai/obsidian-ics/releases/tag/1.5.3 release maintains the fix and we can close this. If you're still seeing it, I am sure we can find some other solution...

@seatrout
Copy link
Author

Is it only main.js that's changed and needs replacing?

@muness
Copy link
Member

muness commented Dec 31, 2023

Yes. if you want the version number to show up correctly that's in manifest.json

@seatrout
Copy link
Author

The 1.5.3 version works, both when there is an event that day, whether it recurs or not, and when there are none. Thank you so much.

@muness
Copy link
Member

muness commented Dec 31, 2023

Thanks for the report and helping test. I wish I could reproduce the issue so I can test against whatever is going wrong in future releases.

For now I'll count on you and other users to let me know if the issue comes back. ;)

@muness muness closed this as completed Dec 31, 2023
@seatrout
Copy link
Author

seatrout commented Jan 1, 2024

Everything still works, and I am still grateful :-)
But in the night I thought of a reason that you might not have been able to reproduce this bug: all of the problems I can remember were expired sequences of recurring events. Recurring events which are still recurring today didn't, so far as I can remember, trigger the bug. But eg "Ann the cleaner" (from my example upthread) no longer comes to clean, so all her end dates showed up as invalid. I think that's it, anyway.

@muness
Copy link
Member

muness commented Jan 1, 2024

Everything still works, and I am still grateful :-)

😌 , phew, I was worried the issue came back the next day when I saw the email notification!

a reason that you might not have been able to reproduce this bug: all of the problems I can remember were expired sequences of recurring events.

Thanks @seatrout , I'll see if that helps in reproducing the issue.

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