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

Cannot sync 2nd calendar from Nextcloud CalDav #492

Open
3 of 7 tasks
brandons209 opened this issue Aug 23, 2023 · 5 comments
Open
3 of 7 tasks

Cannot sync 2nd calendar from Nextcloud CalDav #492

brandons209 opened this issue Aug 23, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@brandons209
Copy link

Please check that this issue hasn't been reported before.

  • I searched previous Bug Reports and didn't find any similar reports.

Expected Behavior

All calendars sync properly from Nextcloud CalDav calendars.

Current behaviour

My main calendar syncs fine, but the second calendar does not sync and gives an error.

JavaScript console output

plugin:obsidian-full-calendar:64715 Revalidation failed with reason: TypeError: Cannot read properties of null (reading 'getFirstValue')
eval @ plugin:obsidian-full-calendar:64715

Steps to reproduce

  1. Add caldav link for nextcloud
  2. All calendars show up properly, click save
  3. Second calendar does not sync

Calendar information

Nextcloud 25.0.2
Calendar App version 4.4.4

Self hosted instance, all other CalDav syncs work as expected.

Which Operating Systems are you using?

  • macOS
  • Windows
  • Linux
  • Android
  • iOS

Obsidian Version

1.3.7

Full Calendar Plugin Version

0.10.7

Checks

  • I have tried it with all other plugins disabled and the error still occurs.

Possible solution

Not sure why the first calendar is able to sync and this one gives an error. I guess some value is not being fetched properly.

Comments

All other calendar sources work fine except this one, including another calendar from the same CalDav link and other ICS calendars.

@brandons209 brandons209 added the bug Something isn't working label Aug 23, 2023
@bepolymathe
Copy link

I have the same problem.

@Sinns
Copy link

Sinns commented Nov 27, 2023

Me too

@pm64
Copy link

pm64 commented Feb 8, 2024

I'm seeing this as well in my testing (exact same error), but with a private Google Calendar ICS link.

@davish, should I try to debug this, or are you already aware of the cause?

UPDATE: on the off chance it was related, I tried swapping in main.js from #470 -- unfortunately, this had no effect.

@jreus
Copy link

jreus commented Feb 20, 2024

I'm having the same issue. Both with a Nextcloud CalDav calendar and with a private Google ICS link.
Seems hit or miss whether my calendars will sync or not!

@maybe-hello-world
Copy link

maybe-hello-world commented Jul 5, 2024

The same issue with the first private Google Calendar ICS link. The public is working.
In particular. the issue is happening when one of the events fails to convert with icsToOFC:

.map((e) => [e.uid, icsToOFC(e)])

Update:
a possible reason is that the function isRecurring defined in the compiled code as:

        isRecurring: function() {
          var comp = this.component;
          return comp.hasProperty("rrule") || comp.hasProperty("rdate");
        }

(not sure where it comes exactly from)

while later it is used like this:

if (input.isRecurring()) {
const rrule = rrulestr(
input.component.getFirstProperty("rrule").getFirstValue().toString()
);

As a result, on an event with rdate but no rrule it breaks because it's parsed as recurrent but doesn't have rrule property.

Hotfix: open compiled plugin code (main.js), find return comp.hasProperty("rrule") || comp.hasProperty("rdate"); and change to return comp.hasProperty("rrule");. After this change, the private calendar is correctly integrated. No idea what it breaks, I'm not a JS developer ¯\(ツ)

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

6 participants