node-red-contrib-ical-events icon indicating copy to clipboard operation
node-red-contrib-ical-events copied to clipboard

[QUESTION]: Fetch ical events of other users calendar.

Open FireWizard52 opened this issue 2 years ago • 13 comments

Hi

Node-RED version v 2.2.2 Ical Node version 2.2.0

I use this node to fetch my own calendar and, with another ical node my wife's calender.

Fetching my own calendar works without any issues, but with exactly the same setting it is not possible to get my wife's calendar. The node responds with "Error: ERROR when trying to convert to ISOStringTypeError: Cannot read property 'match' of null"

As it is not possible, that if you have as calendar type "ical", to set the right username/password I did this include in the URL, as follows: http://username:password@IP address:portnumber/ical. It does not matter whether I put the username/password in front of the IP address or not, my own is working and my wife's calendar not.

Logging in in a browser or http request node works fine this way and gives the data.

It has worked before, so it should have changed during an update of either NR or the node.

Setting the calendar type as Caldav with the correct settings does not function either and therefore I use ical. Using Caldav gives in both cases: "caldav - get calendar went wrong. Error Message: Error: Response with status code: 401"

Any idea, why

  1. Caldav is not working as expected
  2. Ical is not working for another user

Regards

FireWizard52 avatar Apr 08 '22 17:04 FireWizard52

As a new version 2.2.1 has been published recently, I decided to look further into this node,

As mentioned before my own calendar is working, but my wife's calendar is not With exactly the same configuration it gives:

"Error: ERROR when trying to convert to ISOStringTypeError: Cannot read properties of null (reading 'match')"

As it has worked before, I decided to install a previous version. As I have no idea in which version this issue has been introduced I decided to install the latest 1.xx version, so that was 1.5.3.

The first strange thing I noted, if I tried to connect to my CalDav server with ical configuration that the server returned a 401 "Unauthorized". There is no option to configure username/password. If you change the Type in the Config node from ical to CalDav, you will see two configuration fields for Username, resp. Password. Afterwards you have to change the Type back to ical.

And then it works, both for myself and for the calendar of my wife.

So beside a somewhat strange way of configuration for username/password it works. So something has been introduced recently in version 2. I do not know which version.

[Edit] I tested also version 2.0.2. and it failed with the same error. So obviously version 1.5.3. is working fine and updating to version 2.x.x. introduce this issue. I think this is a bug!

FireWizard52 avatar Jun 11 '22 17:06 FireWizard52

Sorry for being away such a long time... Work/Life Balance 😉

The username/password will be available again, with v2.2.2. Give me some days to release a new version ...

naimo84 avatar Jan 06 '23 19:01 naimo84

Hi,

Any news, when a new release will be published?

Regards

FireWizard52 avatar Mar 18 '23 17:03 FireWizard52

Hello @naimo84,

As the new version 2.2.2. has been released yesterday, I decided to give it a try. Unfortunately it has not changed. Still I receive the same error:

"Error: ERROR when trying to convert to ISOStringTypeError: Cannot read property 'match' of null"

It looks that the node is not able to log in. Any idea of a possible reason? Beside that the layout has changed as well and has not been improved (both Firefox and Chrome Browser)

Screenshot_ical_config

Any idea?

Regards

FireWizard52 avatar Apr 03 '23 17:04 FireWizard52

Hey,

can you provide me some flow details, perhaps? Even better would be the ical URLs ;)

You can send it privately via Mail, of course.

Thanks and greets Benjamin

naimo84 avatar Jun 30 '23 09:06 naimo84

Hello @naimo84, Benjamin

My apologies for my very late response. I missed your message completely, as I have been on holiday during that period and I had completely forgotten this issue, after my return home.

As you might know my application is running fine with version 1.5.3 (the latest of version 1)After testing with version 2 it start failing, so I still use 1.5.3.

When I noticed that version 2.2.5 has been published, I decided to test that version. It did not change and the result is the same.

The flow is extremely simple.

An Inject node, followed by the Ical node and followed by the Debug node. And this 2 times, the first with my credentials and the second with my wife credentials.

I use a "Zarafa" server, running on "ClearOS". So no external mailbox, but running in my local LAN The configuration of the Zarafa server, you can find at: https://doc.zarafa.com/6.40/User_Manual/en-US/html/_configure_canlendar_clients.html

However, instead of port 8080, I use 8008., but for the rest I use these URL's

If I select "Caldav", I get an authorization error, both for myself and my wife (code 401) If I select "Ical", it is working fine for myself bit I get the previous posted error for my wife. ("Error: ERROR when trying to convert to ISOStringTypeError: Cannot read property 'match' of null")

Remarkable is, that, if I copy and paste the URL in a browser, the username and password is requested and then an ics file with the correct data is downloaded.

I can send you more information as a PM, such as the data in the ics, screenshots of the config or the flow itself. If you can provide me with your email address. If you need more info, please let me know.

Regards

Herman

FireWizard52 avatar Sep 17 '23 18:09 FireWizard52

Hey Herman,

the flow seems to be quite simple, as you said 😁 The ics-data and screenshots would be very helpful indeed, so I can debug a bit.

my email is: [email protected]

Thanks for your support.

Greets, Benjamin

naimo84 avatar Sep 19 '23 18:09 naimo84

Hello @naimo84, Benjamin.

I'll send you a PM.

Regards,

Herman

FireWizard52 avatar Sep 21 '23 12:09 FireWizard52

Hello Herman, @FireWizard52

I found the error in your ics files. Thanks for providing. 👍

It has something to do with timezone offsets.

DTSTART;TZID=Africa/Tunis:20210723T150000 is working. DTSTART;TZID="(GMT +01:00)":20160919T190000 is NOT working. (UID:3ffcd4b9-3e7d-49cc-a5cd-c09dcb081a7f) I'm using rrule to proceed rrules, and there is a requirement, that timezones have to be in the IANA List

image

https://github.com/jkbrzt/rrule#timezone-support

I will try to convert "(GMT +01:00)" to any iana timezone, but currently I've no idea, if this has any other side effects ^^ GMT +xy:00 can be many timezones 😉

naimo84 avatar Sep 21 '23 18:09 naimo84

Hello Benjamin, @naimo84

Thank you very much for your prompt response.

It's good you found something. I have looked to the settings in Zarafa, but I do not see any options to reconfigure timezone formats.

What I do not understand, is that I can fetch my calendar en I cannot fetch the calendar of my wife. As far as I can see they use the same timezone format. At least, if I use Ical. If I use Caldav with both, I get the authorization error 401.

What I also do not understand, is that everything is working with version 1.5.3 (the latest version 1), but that version 2 is failing. I assume that timezone handling is more or less equal.

Looking forward to a solution.

Regards

Herman

FireWizard52 avatar Sep 22 '23 14:09 FireWizard52

One solution that comes to my mind: a settings in the config dialog where we can override the Timezone from the ics data?


What I do not understand, is that I can fetch my calendar en I cannot fetch the calendar of my wife. As far as I can see they use the same timezone format. At least, if I use Ical. If I use Caldav with both, I get the authorization error 401.

This is because your ics data doesn't contain a (GMT +01:00), your wife's does 😉

Bildschirmfoto 2023-09-22 um 19 14 39


What I also do not understand, is that everything is working with version 1.5.3 (the latest version 1), but that version 2 is failing. I assume that timezone handling is more or less equal.

The big difference is, that with 1.5.3 I used an old version of the node-ical lib from jens-maus, and with v2 I tried to implement the ical-parsing code from jens lib on my own. Most of the Code is cheeky stolen from his latest version at that time 😉

In the old version, the timezone was not computed: https://github.com/jens-maus/node-ical/blob/3ce830dd86104a7ccc8d880b629c5e9dbce0b60c/ical.js#L382

With the latest version it is: https://github.com/jens-maus/node-ical/blob/master/ical.js#L589

I'm sure I have to compute the timezone, otherwise many other flows will fail, because of an offset.

naimo84 avatar Sep 22 '23 17:09 naimo84

Another possible fix would be, that I'm "guessing" the timezone 😁

image

naimo84 avatar Sep 22 '23 17:09 naimo84

Hi Benjamin, @naimo84

I have no clue why the timezone is different between mine and my wife's calendar.

Another possible fix would be, that I'm "guessing" the timezone

I don't think that it is necessary to guess the time zone, because in the field Dateformat the timezone is already set. I would suggest to use that one. It is Timezone for EventSt. (Rest is covered)

Regards

Herman

FireWizard52 avatar Sep 22 '23 17:09 FireWizard52