fix(server): log when local-only evaluation omits continuity flags - #824
Draft
posthog[bot] wants to merge 1 commit into
Draft
posthog[bot] wants to merge 1 commit into
posthog[bot] wants to merge 1 commit into
Conversation
evaluateFlags(onlyEvaluateLocally = true) silently left out every flag with experience continuity on, because local evaluation always treats those flags as inconclusive. Log the omitted flag keys so the caller can see why they are missing. Generated-By: PostHog Desktop Task-Id: 0a6e5669-93e4-40ff-b9af-1be7d03de6fb
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.
💡 Motivation and Context
evaluateFlags(onlyEvaluateLocally = true)loses every flag that has experience continuity on, and nothing tells it why.FlagEvaluator.matchFeatureFlagPropertiesalways throwsInconclusiveMatchExceptionfor these flags. Local-only mode returns only the flags that resolved locally, so these flags disappear with no specific log./flagsstill returns them.evaluateFlagsLocallyrecords the continuity flags inLocalEvaluationOutcome. The log fires only on the local-only return path. When remote fallback is allowed,/flagsfills these flags, so no log is needed there.Note
The message goes through
config.logger, the only log channel the SDK has.PostHogPrintLoggerprints only whendebugis on, so a user withdebugoff still sees nothing. This change does not add a new log level.Still open (not in this PR): return these flags marked as inconclusive, or throw only when a hash key override would actually apply. The second option needs care for group-aggregated flags. I left both out because each one changes public behavior.
💚 How did you test it?
local only evaluation logs the experience continuity flags it omitsinPostHogFeatureFlagsTest. It loads one plain flag and one continuity flag, runs a local-onlyevaluateFlags, and checks three things: only the plain flag comes back, no request goes to/flags, and the log names the continuity flag../gradlew :posthog-server:test spotlessCheckpasses.📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset file🤖 Agent context
Autonomy: Fully autonomous
claude-opus-5-5) from a PostHog inbox report, running in PostHog Desktop.Created with PostHog Desktop from this inbox report.
🤖 Generated with Claude Code