fix(resolver): preserve explicitly requested archived flags - #596
Open
MattiasMTS wants to merge 1 commit into
Open
fix(resolver): preserve explicitly requested archived flags#596MattiasMTS wants to merge 1 commit into
MattiasMTS wants to merge 1 commit into
Conversation
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.
Explicitly requesting an archived flag currently returns no resolved flags because the shared resolver filters out all non-active flags. The Go provider consequently reports
FLAG_NOT_FOUND, even though it already mapsFLAG_ARCHIVEDto OpenFeature'sDISABLEDreason with no error.Include archived flags when explicitly requested so that the existing provider mapping can return the caller's fallback without an error. Resolve-all continues to omit archived flags, and client authorization still applies. Update the shared response documentation and rebuild the Go provider's embedded WASM.
Hosted-state prerequisite
This implements the local resolver portion of the fix. The hosted state must retain archived flag metadata, including the flag name, state and client authorization. A read-only check of a production state snapshot found that an archived flag was absent entirely; this change cannot distinguish archived from nonexistent flags when that metadata is omitted. The hosted state-generation implementation is outside this repository and needs a corresponding change for that case.
Archived flags return the caller's fallback, not the previously rolled-out variant. This follows the documented archive behavior and the provider's error details.
Regression coverage
TestOpenFeatureArchivedFlagexercises a real OpenFeature client, Go provider and embedded WASM through an active-to-archived transition. It checks object and property fallbacks withDISABLEDand no error, preservesFLAG_NOT_FOUNDfor nonexistent and client-inaccessible flags, separates archived/missing metrics, and verifies that archived flags produce no assignments. The test reproduced the failure before rebuilding the WASM with the fix.The shared resolver specification now expects an explicitly requested archive, and
resolve_all_omits_archived_flagspreserves enumeration behavior. Rust and offline Go suites passed; live-service Go tests were excluded. Independent simplification and correctness reviews found no actionable issues.