Skip to content

feat: adopt the session the widget hands over (adopt-session) - #56

Merged
boehlerlukas merged 1 commit into
masterfrom
feat/adopt-session
Oct 19, 2026
Merged

boehlerlukas merged 1 commit into
masterfrom
feat/adopt-session

Conversation

@boehlerlukas

Copy link
Copy Markdown
Contributor

Native side of the "Verify email" workflow step (GleapSDK/Server#2385, GleapSDK/Messenger-App#263; web SDK: GleapSDK/JavaScript-SDK#185).

When a guest verifies an email that belongs to another contact, the server moves the conversation there and the messenger posts adopt-session with that contact's gleapId/gleapHash.

  • GleapWidgetBridge: new adopt-session command → GleapAdoptSessionService.
  • GleapAdoptSessionService: POST /sessions with the handed-over Gleap-Id/Gleap-Hash (the server answers with that session only when the hash signs the id). Adopted only on a 2xx whose gleapId matches, through processSessionActionResult (stores it, restarts events/socket, sends the usual session-update to the open widget).
  • Ignored when the app identified its own user (GleapSessionController.hasIdentifiedUser: last/pending identify or a session with a user id), checked before and after the request, and when it is already the current session. A logout while the request is out drops the answer (generation).
  • session-update carries capabilities: { adoptSession: true }. Without it the messenger falls back to switching only for the current view.

No version bump, no release.

Verified: ./gradlew :gleap:testDebugUnitTest — 214 tests, 0 failures. Not run on a device against a live server (the server side is not deployed).

🤖 Generated with Claude Code

The messenger's Verify email step can move a guest's conversation to the
contact that owns the verified email and posts adopt-session with that
contact's gleapId/gleapHash. The SDK now re-opens the session with that
pair (POST /sessions answers with it only when the hash signs the id),
adopts it on a 2xx whose gleapId matches and pushes the usual
session-update. Ignored when the app identified its own user.
session-update now carries capabilities.adoptSession so the widget knows
the host can do this.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@boehlerlukas
boehlerlukas merged commit a2bb250 into master Oct 19, 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