Skip to content

fix: Surveys 2.0 native fixes - #44

Merged
boehlerlukas merged 4 commits into
masterfrom
fix/surveys-v2-native
Oct 8, 2026
Merged

boehlerlukas merged 4 commits into
masterfrom
fix/surveys-v2-native

Conversation

@boehlerlukas

@boehlerlukas boehlerlukas commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Surveys 2.0: native Android fixes

Surveys 2.0 already render in released Android SDKs, because the survey UI is the Messenger-App web view. This PR fixes what only the native side can:

  • FeedbackWillBeSent, FeedbackSent and OutboundSent fire for 2.0 completions;
  • server-triggered surveys keep their resume data;
  • full-screen surveys go edge to edge;
  • card surveys dim evenly;
  • slow loads are no longer killed after 15 s.

No public API changes and no version bump; the synced SDK release comes later. No wrapper changes are needed, because Flutter, React Native and Capacitor keep forwarding the same callbacks.

Head at time of writing: 6d4fe2d (4 commits). Program overview, master rollout and risks: https://github.com/GleapSDK/Server/pull/2011. Pairs with https://github.com/GleapSDK/Messenger-App/pull/238 and GleapSDK/Gleap-iOS-SDK#48.

Scope

  1. OutboundSentCallback / FeedbackSentCallback fire for v2 surveys.
    • The messenger reports completion as notify-event outbound-sent. GleapWidgetBridge used to handle only flow-started.
    • It now fires FeedbackWillBeSentCallback, then FeedbackSent with the answers, as HttpHelper does.
    • OutboundSent gets outboundId and formData plus everything the messenger reports: outbound, surveyId, responseId, endingId, status: "completed".
    • It tracks outbound-<id>-submitted, and reports a response once per process even if the page reports it again.
    • config-update announces surveyCallbacks: true.
    • survey-shown, survey-legacy and height-update drive items 3 and 6. survey-answered/-completed/-closed/-step-viewed and sheet-viewport are explicit no-ops.
  2. Server-triggered surveys keep their data. GleapEventService used to pass only flow and format. start-survey now carries resume, resumeData (= action.data when resuming) and outboundAction (= action._id || action.id), like the JS SDK.
  3. Full-screen survey edge to edge.
    • ScreenshotTaker flags full surveys (IS_SURVEY_FULL). On survey-shown with format full, the window goes edge to edge: transparent bars, with icon appearance taken from the widget background's luminance.
    • The container only keeps clear of the keyboard, and the page gets the insets as safe-area-update (CSS px; bottom 0 while the keyboard is up).
    • Legacy fallback keeps today's layout. That covers survey-legacy and old messengers that never send survey-shown.
  4. Card survey dim is even. The bands the container keeps clear (system bars, keyboard) used to stay at the loader's dim while the page dim stacked on the rest, giving two tones. After the reveal, the loader fades out and the padding bands get the page's own dim (rgba(0,0,0,0.25), as in appnew.html).
  5. Slow loads are not killed. exitAfterFifteenSeconds closed the widget after 15 s whenever the web view was still invisible. It now waits 30 s, and fires only when the page never pinged and never sent height-update or survey-shown.

(Items 5 and 7 of the program are iOS-only, see Gleap-iOS-SDK#48.)

Old SDKs (7.0–19.1) without this PR: the messenger sends them one legacy send-feedback after a v2 completion (Messenger-App 795b738). The Server answers it with 201 and stores nothing (Server ed8744886), so their FeedbackWillBeSent / FeedbackSent / OutboundSent and the submitted event fire too.

Risk and safety

  • Behaviour change:
    • Callbacks now fire once per 2.0 completion.
    • Answer values are 2.0 values (rating 1..5, priority as a choice id). Migrated surveys keep the legacy field names.
    • Edge to edge applies only once the messenger reports a full-screen survey, so legacy surveys are unaffected.
  • Tests: ./gradlew build test builds successfully. ./gradlew :gleap:testDebugUnitTest runs 203 tests with 0 failures (checked again on 2026-10-07 at 6d4fe2d, level with master, nothing to merge). No new tests (UI and callback changes, per the workspace testing rules).
  • Verified on the API 36 emulator against the local Surveys 2.0 stack (live v2 survey, callbacks logged). This branch and released 19.1.0 each fire widgetOpened → feedbackFlowStarted → feedbackWillBeSent → feedbackSent → outboundSent once, with no ticket created and one survey response each. Message shapes were checked against Messenger-App#238 (SurveyV2.finish, survey-shown data, CommunicationManager start-survey parsing, appnew.html forwarding, body dim and safe-area-update).
  • Not yet checked on a real device: edge-to-edge full screen, card dim bands, and the bottom safe-area inset. These are to do in the release pass.

Rollout (this repo)

This PR is independent of the web rollout: released SDKs keep working through the Server ack. Release it with the next synced native SDK version (Android, iOS, then Flutter, React Native and Capacitor through the sdk-release flow; the dashboard hardcodes the Android version in tutorialContent.ts) after Server#2011 and Messenger-App#238 are live. Merge together with Gleap-iOS-SDK#48. Master checklist: https://github.com/GleapSDK/Server/pull/2011.

Surveys 2.0 PRs

🤖 Generated with Claude Code

boehlerlukas and others added 4 commits October 7, 2026 11:51
…ion in start-survey

Like the JavaScript SDK: a resume reminder continues the server's copy of the
response and a Surveys 2.0 response records the outbound action that delivered
it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ubmitted event

The messenger saves v2 answers itself and reports completion as notify-event
outbound-sent, which only flow-started was handled for. It now invokes the
FeedbackSent and OutboundSent callbacks in the legacy shape (outboundId,
outbound, formData, plus responseId/endingId) and tracks
outbound-<id>-submitted. survey-* lifecycle, height-update and sheet-viewport
are handled (content seen, full-screen layout) or accepted as no-ops.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rd dim, 30s load timeout

Full screen: once a v2 survey shows, the page draws behind the status and
navigation bars and gets the insets as safe-area-update (it pads its close
button, question and bar); the bars no longer show the loader's header color
over the pale survey page. Legacy fallback keeps the old layout.

Card: the bands the container keeps clear of the system bars and the keyboard
stayed at the loader dim (#66000000) while the page dim stacked on the rest
(two tones). After the reveal the loader fades out and the bands get the
page's own dim (rgba(0,0,0,0.25)), so the screen is dimmed evenly.

Load timeout: 30s instead of 15s, and only when the page never pinged and
never reported a height or a shown survey.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…esponse; announce surveyCallbacks

A completed v2 survey fires FeedbackWillBeSent, FeedbackSent (the answers by
key) and OutboundSent like a sent legacy survey; OutboundSent passes on
everything the messenger reports (outbound, surveyId, responseId, endingId,
status) next to outboundId and formData. A response is reported once per
process, also when the page reports it again.

config-update carries surveyCallbacks: true, so the messenger sends this SDK no
legacy send-feedback after a completion (older SDKs get one, which the server
acknowledges without storing anything, to fire the same callbacks).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@boehlerlukas
boehlerlukas merged commit 3046ade into master Oct 8, 2026
1 check passed
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