fix(surveys): exclude web-only display conditions on non-web SDKs - #20
Draft
posthog[bot] wants to merge 1 commit into
Draft
fix(surveys): exclude web-only display conditions on non-web SDKs#20posthog[bot] wants to merge 1 commit into
posthog[bot] wants to merge 1 commit into
Conversation
iOS just fixed rendering CSS-selector/URL-scoped surveys natively; verified Android has the same gap and RN already excludes them, so the spec should state the exclusion as the canonical target rather than staying silent. Generated-By: PostHog Code Task-Id: 7d7cb7ed-0d67-4718-ada0-2b2cd585f3a6
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.
Why
posthog-ios#733 ("don't show web-only surveys (selector/url) on iOS") fixed iOS's
getActiveMatchingSurveyseligibility filter, which decoded a survey'sconditions.selector/conditions.urldisplay-targeting fields but never evaluated them — a survey scoped to web via CSS selector/URL matching rendered natively on iOS with non-functional buttons, since those conditions have no meaning outside a browser DOM. The PR description claims this "keeps parity with the other native SDKs (Android, Flutter, React Native)."That claim only holds up partially. I checked source directly rather than trusting the PR description:
posthog-js'sgetActiveMatchingSurveys.ts) already excludes selector/URL-only-conditioned surveys, with dedicated test coverage — it was never affected.PostHogSurveysIntegration.getActiveMatchingSurveys()) never readsconditions.selector/conditions.urlat all — the exact same gap iOS just fixed, still present.openspec/specs/surveys/spec.mdbehavior item 5 only names "platform-specific display constraints" — vague enough to not actually state this rule. Per this repo's stated purpose (state the canonical winner where SDKs diverge), React Native's pre-existing correct behavior — now matched by iOS — is the target; Android and Flutter are documented as not yet conforming rather than silently assumed fixed.What this PR does
@clientscenario to theCanonical surveys behaviorrequirement (viaopenspec/changes/archive/2026-07-31-exclude-web-only-survey-conditions/, following this repo's propose→archive convention).openspec validate --specs --strictpasses.Uncertain / flagged for reviewer attention
PostHogSurveysIntegration.ktdirectly, not just trusting the iOS PR's parity claim. This PR only documents the target contract; it does not fix Android or open tracking work for it (noted intasks.md§4).Created with PostHog Code