You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue is similar to #166 but for Redis with []byte values. When getting a []byte value the cache returns an empty []byte without an error. This is because the Redis implementation always returns strings and fails when trying to convert the value to string. Since it silently fails, it was difficult to debug.
fmt.Printf("cached value len: %v\n", len(cachedValue))
Expected behavior:
The returned value is the stored []byte not and empty value
Actual behavior:
It silently returns an empty []byte instead of the stored value
Platforms:
macOS and dockerized Linux from scratch
Versions:
gocache v4.1.3
go 1.21
Redis store v4.2.0
Redis client v9.0.5
Redis server 7.0.12
The text was updated successfully, but these errors were encountered:
butaca
changed the title
Redis Get silently returns ab empty []byte for stored []byte values
Redis Get silently returns an empty []byte for stored []byte values
Aug 27, 2023
@ekoMaybe we can add a Mashaler and Unmashaler to the cache and allow users to choose whether to use them or not? This will solve the problem of this type mismatch.
update:
The Marshaler package has implemented encapsulation logic for cached data.
The issue is similar to #166 but for Redis with []byte values. When getting a []byte value the cache returns an empty []byte without an error. This is because the Redis implementation always returns strings and fails when trying to convert the value to string. Since it silently fails, it was difficult to debug.
Steps for Reproduction
Expected behavior:
The returned value is the stored []byte not and empty value
Actual behavior:
It silently returns an empty []byte instead of the stored value
Platforms:
macOS and dockerized Linux from scratch
Versions:
gocache v4.1.3
go 1.21
Redis store v4.2.0
Redis client v9.0.5
Redis server 7.0.12
The text was updated successfully, but these errors were encountered: