dolanor / caldav-go

clone from taviti/caldav-go that disappeared
MIT License
21 stars 13 forks source link

"panic: reflect: call of reflect.Append on ptr Value" during hydrateProperty #3

Open raoel opened 3 years ago

raoel commented 3 years ago

It looks like it cannot hydrate the following property, when I run it in a debugger that is the property being handled.

CATEGORIES:http://schemas.google.com/g/2005#event

I just started with Golang, I already tried to fix it but I can't :-/ I guess it's the hash "#" ?

stack:

panic: reflect: call of reflect.Append on ptr Value

goroutine 1 [running]:
reflect.flag.mustBe(0x196, 0x17)
    /usr/lib/golang/src/reflect/value.go:208 +0xde
reflect.Append(0x8121e0, 0xc0001303c0, 0x196, 0xc00019ea68, 0x1, 0x1, 0x0, 0x0, 0x0)
    /usr/lib/golang/src/reflect/value.go:2032 +0x60
github.com/dolanor/caldav-go/icalendar.hydrateProperty(0x8121e0, 0xc0001303c0, 0x196, 0xc0000cc280, 0x0, 0x0)
    /home/roomen/go/pkg/mod/github.com/dolanor/caldav-go@v0.2.0/icalendar/unmarshal.go:200 +0x5df
github.com/dolanor/caldav-go/icalendar.hydrateProperties(0x82ba80, 0xc0001302c0, 0x16, 0xc0004ad5e0, 0x0, 0x0)
    /home/roomen/go/pkg/mod/github.com/dolanor/caldav-go@v0.2.0/icalendar/unmarshal.go:270 +0x4e0
github.com/dolanor/caldav-go/icalendar.hydrateComponent(0x82ba80, 0xc0001302c0, 0x16, 0xc0004ad5e0, 0x0, 0x0)
    /home/roomen/go/pkg/mod/github.com/dolanor/caldav-go@v0.2.0/icalendar/unmarshal.go:302 +0x412
github.com/dolanor/caldav-go/icalendar.hydrateNestedComponent(0x7f2580, 0xc0006ce4e8, 0x197, 0xc0004ad5e0, 0x0, 0x0)
    /home/roomen/go/pkg/mod/github.com/dolanor/caldav-go@v0.2.0/icalendar/unmarshal.go:224 +0x120
github.com/dolanor/caldav-go/icalendar.hydrateProperties(0x821e20, 0xc0006ce480, 0x16, 0xc0004ad440, 0x0, 0x0)
    /home/roomen/go/pkg/mod/github.com/dolanor/caldav-go@v0.2.0/icalendar/unmarshal.go:284 +0xbd2
github.com/dolanor/caldav-go/icalendar.hydrateComponent(0x821e20, 0xc0006ce480, 0x16, 0xc0004ad440, 0x0, 0x0)
    /home/roomen/go/pkg/mod/github.com/dolanor/caldav-go@v0.2.0/icalendar/unmarshal.go:302 +0x412
github.com/dolanor/caldav-go/icalendar.hydrateValue(0x821e20, 0xc0006ce480, 0x16, 0xc0004ad3c0, 0x0, 0x0)
    /home/roomen/go/pkg/mod/github.com/dolanor/caldav-go@v0.2.0/icalendar/unmarshal.go:353 +0xf1b
github.com/dolanor/caldav-go/icalendar.Unmarshal(0xc0003a4480, 0x231, 0x821e20, 0xc0006ce480, 0x0, 0x0)
    /home/roomen/go/pkg/mod/github.com/dolanor/caldav-go@v0.2.0/icalendar/unmarshal.go:363 +0x1e1
github.com/dolanor/caldav-go/caldav.(*Response).Decode(0xc000162120, 0x821e20, 0xc0006ce480, 0x0, 0x0)
    /home/roomen/go/pkg/mod/github.com/dolanor/caldav-go@v0.2.0/caldav/response.go:29 +0x2f3
github.com/dolanor/caldav-go/caldav.(*Client).GetEvents(0xc00000e380, 0xc00036c0c0, 0x51, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/roomen/go/pkg/mod/github.com/dolanor/caldav-go@v0.2.0/caldav/client.go:130 +0x732

for completeness the whole Event that I'm fetching:

BEGIN:VCALENDAR
CALSCALE:GREGORIAN
VERSION:2.0
PRODID:-//SabreDAV//SabreDAV//EN
BEGIN:VEVENT
DTSTART;VALUE=DATE:20120114
DTEND;VALUE=DATE:20120115
DTSTAMP:20150209T114140Z
UID:REDACTED_IDENTIFIER@google.com
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;X-NUM-GUE
 STS=0:mailto:REDACTED@REDACTED.COM
CREATED:20111214T180041Z
DESCRIPTION:
LAST-MODIFIED:20111214T180041Z
LOCATION:Thuis
SEQUENCE:1
STATUS:TENTATIVE
SUMMARY:REDACTED BECAUSE PRIVACY
TRANSP:OPAQUE
CATEGORIES:http://schemas.google.com/g/2005#event
END:VEVENT
END:VCALENDAR
dolanor commented 3 years ago

Thanks for you patience, I totally forgot your issue. I'll try to reproduce and get back to you this week.

dolanor commented 3 years ago

Sorry it took so long, been quite busy. I found out that you're right, the problem is with the CATEGORIES, but not because of the #. It's the whole underlying type which doesn't hydrate correctly. the CONTACT is of the same type (type.CSV) and fails the same. I'm gonna try and fix it and update this issue when it's done.