Skip to content

fix(resolver): preserve explicitly requested archived flags - #596

Open
MattiasMTS wants to merge 1 commit into
spotify:mainfrom
MattiasMTS:ms/archived-flag-resolution
Open

fix(resolver): preserve explicitly requested archived flags#596
MattiasMTS wants to merge 1 commit into
spotify:mainfrom
MattiasMTS:ms/archived-flag-resolution

Conversation

@MattiasMTS

Copy link
Copy Markdown
Contributor

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 maps FLAG_ARCHIVED to OpenFeature's DISABLED reason 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

TestOpenFeatureArchivedFlag exercises a real OpenFeature client, Go provider and embedded WASM through an active-to-archived transition. It checks object and property fallbacks with DISABLED and no error, preserves FLAG_NOT_FOUND for 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_flags preserves enumeration behavior. Rust and offline Go suites passed; live-service Go tests were excluded. Independent simplification and correctness reviews found no actionable issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant