Repository navigation
Conversation
Config#private_attributes now returns a Set of attribute reference strings instead of an Array. The :private_attributes option still accepts any Enumerable, and the SDK converts it to a Set. LDContext#private_attributes now returns a frozen Set of Reference objects instead of an Array. The context already stored a Set internally and copied it to an Array on every call. Private attributes have no meaningful order or duplicates, so a Set is the correct type. Code that indexes into the result or calls Array-only methods on it must change. LDContext#to_h and #to_json still emit privateAttributes as an Array, so serialized contexts and event payloads do not change.
keelerm84
marked this pull request as ready for review
November 2, 2026 16:51
This branch has not been deployed
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.
Config#private_attributes now returns a Set of attribute reference
strings instead of an Array. The :private_attributes option still
accepts any Enumerable, and the SDK converts it to a Set.
LDContext#private_attributes now returns a frozen Set of Reference
objects instead of an Array. The context already stored a Set
internally and copied it to an Array on every call. Private attributes
have no meaningful order or duplicates, so a Set is the correct type.
Code that indexes into the result or calls Array-only methods on it
must change. LDContext#to_h and #to_json still emit privateAttributes
as an Array, so serialized contexts and event payloads do not change.
Note
Overview
Breaking change:
Config#private_attributesandLDContext#private_attributesnow exposeSetvalues instead ofArray. The:private_attributesconfig option still accepts anyEnumerable, which the SDK normalizes into a set (deduping entries).On
LDContext, the internal set is frozen after construction, the accessor no longer copies to an array on each call, and equality checks use set comparison directly.ContextFilterstores global private refs in a set and merges them with per-context refs via set union (|) instead of array concatenation.Wire format unchanged:
LDContext#to_h/ serialization still emitprivateAttributesas an array (private_attributes.to_a). Callers that indexed into or relied onArray-only APIs on the getters must migrate to set-friendly usage.Reviewed by Cursor Bugbot for commit 80b0603. Bugbot is set up for automated code reviews on this repo. Configure here.