ahoy icon indicating copy to clipboard operation
ahoy copied to clipboard

Fix `NoMethodError` when no request and `cookies == :none`

Open rgarner opened this issue 2 months ago • 0 comments

When tracking with no request,

Ahoy.cookies = :none
Ahoy::Tracker.new.track_event(:would_fail)

would raise NoMethodError: undefined method 'remote_ip' for nil. Since we explicitly don't have a request, allow visitor_token_helper to fall back on generate_id by returning nil from visitor_anonymity_set when there is no request.

rgarner avatar Apr 11 '24 17:04 rgarner