naimo84 / node-red-contrib-ical-events

Node-RED module to get events from a iCal Calender (Google e.g.), icloud or Caldav Server via kalender-events
MIT License
47 stars 11 forks source link

Trigger node emits identical message on start / end for different events #87

Closed e-lange closed 3 years ago

e-lange commented 3 years ago

The trigger node emits identical messages when two events end and start at the same time It seems that in the case a caldav server provides multiple calendars the emitted messages at the two outputs point to the same message in case two events (in two calendars) end and start at the same time. Is it possible that the emitted object is not a new JavaScript object for each new event but referencing only single object? (I am speculating here)

To Reproduce Steps to reproduce the behavior:

  1. Schedule two events in one account in different calendars
  2. Match the start time of one event to exactly the end time of the other event
  3. Use the trigger node and debug the output of the Start and End Message output of the node
  4. The two messages are identical and seem to stem from only one of the two events

Expected behavior The end message should match the event just ended and the start message should match the event just started.

Screenshots Two events matching start and end time in two calendars (Studio & Erdgeschoss): grafik grafik

Trigger node: grafik

And the debug messages (please node the subtle difference of the emitting node): grafik grafik

Apparently, the messages do not differ and seem to stem from one calendar Erdgeschoss only.

Versions

Additional As usual, if you need more info, more reproducers, more context, please let me know.

e-lange commented 3 years ago

Hi @naimo84,

thanks for the super quick response!

I just tried beta.7 and it does not seem to detect recurring events properly: grafik

This is what I get with beta.6, which is the expected point in time for the trigger: grafik

Can you replicate this or do you need some ics-events?

Cheers

naimo84 commented 3 years ago

Hey @e-lange,

you're most welcome ;) I don't know why this changed between beta.6 and beta.7

Normally I'm testing with a Sogo Caldav server, this is working with both beta versions... Now I switched to my nextcloud CalDav server, and I can reproduce your problem.

Sometimes it's really annoying, that each server interprets the ics/caldav "standard" differently πŸ˜‰

I'll investigate and will report back soon

Greets, Benjamin

naimo84 commented 3 years ago

Hey, I'm back 😁

parenthesis are sometimes very useful πŸ‘

(ev.uid.uid ? ev.uid.uid : ev.uid) + eventStart.toISOString() + "start" vs. ev.uid.uid ? ev.uid.uid : ev.uid + eventStart.toISOString() + "start"

is definitly not the same ;) Sorry for that... beta.8 is online

Greets

e-lange commented 3 years ago

Hi,

indeed, those parenthesis do have an impact :) I just tested 1.0.0-beta.8 and it seems to work as expected. I will keep it running.

Great job! I will send you a coffee or a beer - which ever you prefer.

Cheers

naimo84 commented 3 years ago

Hey @e-lange,

you are crazy, many many thanks for the ko-fi πŸ˜‰ I will put it in my daughter's piggy bank.

and perhaps one beer πŸ‘

cheers