Skip to content

Bug: cache umarshalling custom JSONB type fails #14

@ivanvanderbyl

Description

@ivanvanderbyl

We have a number of fields which store arrays of enum string values in JSONB columns. When we get a cache hit, it instead returns this error:

unmarshal field borders: invalid character '\\x00' looking for beginning of value

Ent schema in question:

// in ent/schema/route.go
field.JSON("borders", customfield.Borders{}),

// in customfield/borders.go
type Border string
type Borders []Border
const (
	BorderAIR     Border = "AIR"
	BorderLAND    Border = "LAND"
	BorderSEA     Border = "SEA"
	BorderUnknown Border = "UNKNOWN"
)

Is there something we need to implement for cache marshalling/unmarshalling into the cache?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions