Skip to content

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

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

boehlerlukas merged 1 commit into
mainfrom
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; Android: GleapSDK/Android-SDK#56).

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.

  • GleapFrameManagerViewController: new adopt-session message (behind the existing trusted-message check) → GleapSessionHelper adoptSessionWithId:hash:.
  • adoptSessionWithId:hash:: 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 updateLocalSessionWith (stores gleapId/gleapHash, sends the usual session-update).
  • Ignored when the app identified its own user (last/open identify or a session with a user id), checked before and after the request, and when it is already the current session.
  • 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: xcodebuild test -scheme Gleap on the iPhone 17 Pro simulator — 131 tests, 0 failures. Not run 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 b86a0bb into main 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