isene / VcalView

VCAL viewer for MUTT
The Unlicense
10 stars 1 forks source link

Undefined Method Error #1

Open mehalter opened 4 years ago

mehalter commented 4 years ago

Hey, nice work with this script! I'm very excited to get Outlook invite information into mutt. I put the script on my machine and tried running it, and some of the invites that I have are returning the following error. It seems like if all of the information of the invitation is defined, then there are failures with nil. It would be nice for this to fail nicely and just not include information that isn't included in the calendar invitation.

calview.rb:35:in `<main>': undefined method `sub' for nil:NilClass (NoMethodError)
isene commented 4 years ago

Will fix tomorrow.

Could you post the vcal file here?

isene commented 4 years ago

I may have fixed it. Check at your end.

mehalter commented 4 years ago

It doesn't look like it is working fully, I am still getting errors on different lines when certain calendar invite fields aren't included

/home/micah/.local/bin/calview.rb:42:in `<main>': undefined method `gsub' for nil:NilClass (NoMethodError)

here is the raw calendar information that returns the above error, but this happens on different lines depending on which information is not in the calendar invite (this case it has no description field). Also I should note that all of these are edge cases of events created in outlook, not manually created in some way.

BEGIN:VCALENDAR
METHOD:REQUEST
PRODID:Microsoft Exchange Server 2010
VERSION:2.0
BEGIN:VTIMEZONE
TZID:Eastern Standard Time
BEGIN:STANDARD
DTSTART:16010101T020000
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T020000
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2SU;BYMONTH=3
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
ORGANIZER;CN="Person, Redacted":MAILTO:organizer@redacted.com
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="Person, Redacted":MAILTO:attendee@redacted.com
UID:7B5C57BC-A613-4230-9D41-CAC75946EC59
SUMMARY;LANGUAGE=en-US:redacted summary
DTSTART;TZID=Eastern Standard Time:20200914T090000
DTEND;TZID=Eastern Standard Time:20200914T100000
CLASS:PUBLIC
PRIORITY:5
DTSTAMP:20200901T181606Z
TRANSP:OPAQUE
STATUS:CONFIRMED
SEQUENCE:0
LOCATION;LANGUAGE=en-US:webex
X-MICROSOFT-CDO-APPT-SEQUENCE:0
X-MICROSOFT-CDO-OWNERAPPTID:2118715795
X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-INSTTYPE:0
X-MICROSOFT-DONOTFORWARDMEETING:FALSE
X-MICROSOFT-DISALLOW-COUNTER:FALSE
END:VEVENT
END:VCALENDAR
isene commented 4 years ago

Check if this latest fix handles the problem. Are the times correct? If not, what should they be?

mehalter commented 4 years ago

That fixed it for a lot of the cases, I am still getting issues for stuff like the following example:

error:

calview.rb:50:in `<main>': undefined method `sub' for nil:NilClass (NoMethodError)

vcal:

BEGIN:VCALENDAR
METHOD:REQUEST
PRODID:Microsoft Exchange Server 2010
VERSION:2.0
BEGIN:VTIMEZONE
TZID:Eastern Standard Time
BEGIN:STANDARD
DTSTART:16010101T020000
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=1SU;BYMONTH=11
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T020000
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=2SU;BYMONTH=3
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
ORGANIZER;CN="Person, Redacted":MAILTO:organizer@redacted.com
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="Person, Redacted":MAILTO:attendee@redacted.com
UID:1CB9D08F-1F77-4EEB-A895-AA4DD3025AF6
SUMMARY;LANGUAGE=en-US:Redacted Summary
DTSTART;VALUE=DATE:20200914
DTEND;VALUE=DATE:20200915
CLASS:PUBLIC
PRIORITY:5
DTSTAMP:20200901T181533Z
TRANSP:OPAQUE
STATUS:CONFIRMED
SEQUENCE:0
X-MICROSOFT-CDO-APPT-SEQUENCE:0
X-MICROSOFT-CDO-OWNERAPPTID:2118716727
X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
X-MICROSOFT-CDO-ALLDAYEVENT:TRUE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-INSTTYPE:0
X-MICROSOFT-DONOTFORWARDMEETING:FALSE
X-MICROSOFT-DISALLOW-COUNTER:FALSE
BEGIN:VALARM
DESCRIPTION:REMINDER
TRIGGER;RELATED=START:-PT15H
ACTION:DISPLAY
END:VALARM
END:VEVENT
END:VCALENDAR
isene commented 4 years ago

You are very responsive. I really appreciate your testing. Will fix, but tomorrow - as it is getting late here.

isene commented 4 years ago

Damn, couldn't leave it alone. Check the latest.

mehalter commented 4 years ago

I pulled the latest and I think it is working for all of the cases I have! Thanks for all of your help and getting all of this stuff fixed

isene commented 4 years ago

You are very welcome. Thanks for being such a willing tester. And don't hesitate to ask for more.