diff --git a/src/internal/converters/eml/eml.go b/src/internal/converters/eml/eml.go index 119730f2e..9b0607a4c 100644 --- a/src/internal/converters/eml/eml.go +++ b/src/internal/converters/eml/eml.go @@ -237,15 +237,12 @@ func FromJSON(ctx context.Context, body []byte) (string, error) { } if bytes == nil { - // Some attachments have an "item" field instead of - // "contentBytes". There are items like contacts, emails - // or calendar events which will not be a normal format - // and will have to be converted to a text format. - // TODO(meain): Handle custom attachments + // TODO(meain): Handle non file attachments // https://github.com/alcionai/corso/issues/4772 logger.Ctx(ctx). - With("attachment_id", ptr.Val(attachment.GetId())). - Info("unhandled attachment type") + With("attachment_id", ptr.Val(attachment.GetId()), + "attachment_type", ptr.Val(attachment.GetOdataType())). + Info("no contentBytes for attachment") continue } diff --git a/src/internal/converters/ics/ics.go b/src/internal/converters/ics/ics.go index 3e8277561..1aceccd1f 100644 --- a/src/internal/converters/ics/ics.go +++ b/src/internal/converters/ics/ics.go @@ -17,6 +17,7 @@ import ( "github.com/alcionai/corso/src/internal/common/ptr" "github.com/alcionai/corso/src/internal/common/str" "github.com/alcionai/corso/src/pkg/dttm" + "github.com/alcionai/corso/src/pkg/logger" "github.com/alcionai/corso/src/pkg/services/m365/api" ) @@ -527,7 +528,6 @@ func updateEventProperties(ctx context.Context, event models.Eventable, iCalEven } // ATTACH - https://www.rfc-editor.org/rfc/rfc5545#section-3.8.1.1 - // TODO Handle different attachment types (file, item and reference) attachments := event.GetAttachments() for _, attachment := range attachments { props := []ics.PropertyParameter{} @@ -548,6 +548,17 @@ func updateEventProperties(ctx context.Context, event models.Eventable, iCalEven return clues.WrapWC(ctx, err, "getting attachment content") } + if cb == nil { + // TODO(meain): Handle non file attachments + // https://github.com/alcionai/corso/issues/4772 + logger.Ctx(ctx). + With("attachment_id", ptr.Val(attachment.GetId()), + "attachment_type", ptr.Val(attachment.GetOdataType())). + Info("no contentBytes for attachment") + + continue + } + content, ok := cb.([]uint8) if !ok { return clues.NewWC(ctx, "getting attachment content string").