-
Notifications
You must be signed in to change notification settings - Fork 460
Open
Description
Description
When storing a nil
value with the raw: true
request option, Dalli stores an empty string even though cache_nils
is false [ref]. This especially doesn't play nice with a custom serializer. @petergoldstein I'm curious to get your thoughts on whether we should instead raise an ArgumentError
in this situation instead of storing an empty string (although it would be a breaking change).
irb(main):001> require "dalli"
irb(main):002> c = Dalli::Client.new("127.0.0.1:11211", cache_nils: false)
irb(main):003> c.set("foo", nil, 0, raw: true)
irb(main):004> c.get("foo")
=> ""
Expected Behaviour
irb(main):001> require "dalli"
irb(main):002> c = Dalli::Client.new("127.0.0.1:11211", cache_nils: false)
irb(main):003> c.set("foo", nil, 0, raw: true) <= ArgumentError
Metadata
Metadata
Assignees
Labels
No labels