Skip to content

feat(surveys): auto-submit eligible survey responses - #591

Open
lucasheriques wants to merge 1 commit into
mainfrom
lucas/surveys-auto-submit
Open

lucasheriques wants to merge 1 commit into
mainfrom
lucas/surveys-auto-submit

Conversation

@lucasheriques

@lucasheriques lucasheriques commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

Moves surveys toward feature parity across SDKs. With skipSubmitButton enabled, selecting a rating or a single choice submits the answer and follows the native SDK's next-question result. Multiple-choice questions and single-choice questions with an open choice keep their submit button.

Passes the setting through the iOS/Android bridges and prevents duplicate submissions while a native response is pending. Requires iOS 3.77.0+ and Android 3.66.4+, from PostHog/posthog-ios#808 and PostHog/posthog-android#769.

Closes #262.

💚 How did you test it?

  • 660 Flutter tests passed. The 14 new interaction cases cover numeric/emoji ratings, flag defaults, open/multiple-choice fallback, branching, duplicate taps, and disposal during a pending response.
  • Dart analysis, formatting, public API snapshot check, and native formatting passed. iOS simulator, macOS, and web example builds passed.
  • All GitHub checks now pass, including Android and both CocoaPods/SPM iOS and macOS builds. The native dependencies are available.
  • CodeScene: no findings in the new tests or widget changes. Scoped exception for two added fields extending the existing long Kotlin/Dart serializers; serializer refactoring is deferred.

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

If releasing new changes

  • Ran pnpm changeset to generate a changeset file

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Implemented with Codex, GitHub CLI, Flutter/Gradle/Xcode build tools, and CodeScene. Follows the native SDK eligibility rules and uses widget interaction tests to verify the Dart rendering path. Human review required.

Carry skipSubmitButton through both native bridges and the internal Dart survey models. Submit ratings and single-choice answers immediately when enabled; keep explicit submission for open choices and multiple choice. Guard pending native responses against duplicate taps and disposed UI updates.

Move survey behavior toward parity with web and native SDKs. Raise native floors to iOS 3.77.0 and Android 3.66.4; add a minor changeset.

Validation: 660 Flutter tests passed, including 14 interaction cases (five failed before implementation). Dart analysis, formatting, public API snapshot check, Kotlin/Swift formatting, and iOS simulator/macOS/web example builds passed. Android release build awaits the new Maven artifact; the local composite fallback encountered native build configuration/lock incompatibilities.

CodeScene exception: two added payload fields extend existing long Kotlin and Dart serializers; the gate reports small length-based degradations. The new tests and widget changes have no findings. Broader serializer refactoring is intentionally deferred to keep this change focused.
@lucasheriques lucasheriques added enhancement New feature or request Survey labels Sep 17, 2026
@lucasheriques lucasheriques self-assigned this Sep 17, 2026
@greptile-apps

greptile-apps Bot commented Sep 17, 2026

Copy link
Copy Markdown

Retrigger

The PR appears safe to merge with no actionable correctness, security, or repository-rule issues identified.

Reviews (1) · Last reviewed commit: "feat(surveys): auto-submit eligible surv..."

@github-actions

Copy link
Copy Markdown
Contributor

posthog-flutter Compliance Report

Date: 2026-09-17 17:06:19 UTC
Duration: 96873ms

✅ All Tests Passed!

45/45 tests passed


Capture Tests

29/29 tests passed

View Details
Test Status Duration
Format Validation.Event Has Required Fields 144ms
Format Validation.Event Has Uuid 121ms
Format Validation.Event Has Lib Properties 117ms
Format Validation.Distinct Id Is String 115ms
Format Validation.Token Is Present 116ms
Format Validation.Custom Properties Preserved 117ms
Format Validation.Event Has Timestamp 118ms
Retry Behavior.Retries On 503 5330ms
Retry Behavior.Does Not Retry On 400 2118ms
Retry Behavior.Does Not Retry On 401 2118ms
Retry Behavior.Respects Retry After Header 8126ms
Retry Behavior.Implements Backoff 15446ms
Retry Behavior.Retries On 500 5228ms
Retry Behavior.Retries On 502 5228ms
Retry Behavior.Retries On 504 5226ms
Retry Behavior.Max Retries Respected 15446ms
Deduplication.Generates Unique Uuids 128ms
Deduplication.Preserves Uuid On Retry 5225ms
Deduplication.Preserves Uuid And Timestamp On Retry 10336ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry 5232ms
Deduplication.No Duplicate Events In Batch 125ms
Deduplication.Different Events Have Different Uuids 117ms
Compression.Sends Gzip When Enabled 117ms
Batch Format.Uses Proper Batch Structure 114ms
Batch Format.Flush With No Events Sends Nothing 109ms
Batch Format.Multiple Events Batched Together 124ms
Error Handling.Does Not Retry On 403 2116ms
Error Handling.Does Not Retry On 413 2118ms
Error Handling.Retries On 408 5225ms

Feature_Flags Tests

16/16 tests passed

View Details
Test Status Duration
Request Payload.Request With Person Properties Device Id 13ms
Request Payload.Flags Request Uses V2 Query Param 10ms
Request Payload.Flags Request Hits Flags Path Not Decide 10ms
Request Payload.Flags Request Omits Authorization Header 9ms
Request Payload.Token In Flags Body Matches Init 10ms
Request Payload.Groups Round Trip 9ms
Request Payload.Groups Default To Empty Object 10ms
Request Payload.Person Properties Distinct Id Auto Populated When Caller Omits It 10ms
Request Payload.Disable Geoip False Propagates As Geoip Disable False 9ms
Request Payload.Disable Geoip Omitted Defaults To False 9ms
Request Payload.Flag Keys To Evaluate Contains Only Requested Key 10ms
Request Lifecycle.No Flags Request On Init Alone 5ms
Request Lifecycle.No Flags Request On Normal Capture 113ms
Request Lifecycle.Two Flag Calls Produce Two Remote Requests 17ms
Request Lifecycle.Mock Response Value Is Returned To Caller 10ms
Side Effect Events.Get Feature Flag Captures Feature Flag Called Event 117ms

@lucasheriques
lucasheriques marked this pull request as ready for review September 17, 2026 20:31
@lucasheriques
lucasheriques requested a review from a team as a code owner September 17, 2026 20:31
@marandaneto
marandaneto requested a review from a team September 18, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Survey

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support auto-submit on selection (skipSubmitButton)

1 participant