Repository navigation
fix: Allow null trait values - #101
Merged
Merged
Conversation
Contributor
Author
|
@themis-blindfold review |
⚖️ Themis review: 🟠 Fix before mergeTL;DR: Null traits now serialise through all request paths, but the public
🟠 Majors
📝 Walkthrough
🧪 How to verify
Product take: This makes trait deletion usable across the SDK’s standard update paths. It is a small but important consistency fix for applications that model trait changes immutably. 🧭 Assumptions & unverified claimsNo unverified assumptions or claims. One last null-shaped pebble remains in the immutable path · reviewed at a37840a |
Contributor
Author
|
@themis-blindfold review |
khvn26
approved these changes
Oct 21, 2026
talissoncosta
approved these changes
Oct 21, 2026
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.
Sending a trait with a
nullvalue threwArgumentError: Invalid value type, sogetFeatureFlags(user: …, traits: [Trait(key: 'plan', value: null)])failed before making the request. In Flagsmith, anulltrait value deletes the trait, sonullis a valid value.TraitandTraitWithIdentitynow acceptnullin both directions. Anullvalue is sent as"trait_value": null, and anullvalue in a response parses asnullinstead of throwing.*.g.dartis unchanged: it already writestrait_valueeven when it isnull.Tests cover parsing and serialising null for both classes, and assert the identity request body for a null trait. Without the fix, all four new tests fail.
Traits are not persisted in the SDK's flag storage, so no cache changes are needed.