apognu/gocal

Wrong error "could not parse duplicate RECURRENCE-ID"

Closed this issue · 2 comments

Trying to parse this ics results in the error in the title. I don't find any duplicate here.

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Apple Inc.//Mac OS X 10.12.3//EN
CALSCALE:GREGORIAN
BEGIN:VEVENT
TRANSP:OPAQUE
DTEND;TZID=Europe/Rome:20160813T194500
X-APPLE-IGNORE-ON-RESTORE:TRUE
LAST-MODIFIED:20160806T202301Z
UID:7B00C665-04EB-40AA-80D5-CF40FE636A35
DTSTAMP:20160813T064448Z
LOCATION:Some location here
STATUS:CONFIRMED
SEQUENCE:0
X-APPLE-SCHEDULETAG:
X-APPLE-EWS-BUSYSTATUS:BUSY
RECURRENCE-ID;TZID=Europe/Rome:20160813T093000
SUMMARY:Work work work
DTSTART;TZID=Europe/Rome:20160813T093000
X-APPLE-TRAVEL-ADVISORY-BEHAVIOR:AUTOMATIC
CREATED:20160813T064445Z
X-APPLE-ETAG:"C=8541@U=4744e3f4-75db-4a8d-a41b-9ef147659965"
BEGIN:VALARM
X-WR-ALARMUID:CC293013-456B-4BAA-851B-1F62BC6B381A
UID:CC293013-456B-4BAA-851B-1F62BC6B381A
TRIGGER;VALUE=DATE-TIME:19760401T005545Z
ACTION:NONE
END:VALARM
BEGIN:VALARM
X-WR-ALARMUID:3BC6CCD7-D2FD-406B-8960-254F18D99901
UID:3BC6CCD7-D2FD-406B-8960-254F18D99901
TRIGGER:-PT15M
ATTACH;VALUE=URI:Basso
ACTION:AUDIO
END:VALARM
END:VEVENT
END:VCALENDAR

I'm debugging it now

Yep, copy-paste issue in gocal.go. Here is the line:

case "RECURRENCE-ID":
if gc.buffer.RecurrenceID != "" {
  return fmt.Errorf("could not parse duplicate %s: %s", l.Key, l.Value)
}

gc.buffer.RecurrenceID = l.Value

Fixed.