Repository navigation
fix: Keep analytics events with zero context cache capacity - #534
Open
fallintoplace wants to merge 1 commit into
Open
fallintoplace wants to merge 1 commit into
fallintoplace wants to merge 1 commit into
Conversation
Contributor
|
@fallintoplace thank you for submitting this PR. I am going to review this with our team as this particular issue is impacts more than just the python server sdk and we need to decide how we want to address this for all SDKs. Can you share more about your use case for setting it to 0 or -1 so I can bring that up in the discussion. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
context_keys_capacity=0.Why
KeyErrorand drops identify, custom, and feature events.Implementation
Note
Overview
Fixes analytics delivery when
context_keys_capacity=0by treating zero or negative LRU capacity as a no-op cache.SimpleLRUCache.putnow returnsFalseimmediately whencapacity <= 0, so nothing is stored and the event pipeline no longer hits errors from an effectively empty context-key cache (which previously dropped identify, custom, and feature events).With capacity zero, context deduplication is disabled: each event is treated as a new context, so payloads include repeated index/identify entries (covered by new sync and async event-processor tests, plus LRU unit tests for capacities 0 and -1).
Reviewed by Cursor Bugbot for commit 6354988. Bugbot is set up for automated code reviews on this repo. Configure here.