Repository navigation
feat: adopt a session handed over by the widget after a verified email - #185
Open
boehlerlukas wants to merge 1 commit into
Open
boehlerlukas wants to merge 1 commit into
boehlerlukas wants to merge 1 commit into
Conversation
The Messenger's "Verify email" step can move a conversation to the contact
with that email. The widget then posts `adopt-session {gleapId, gleapHash}`;
the SDK checks it with POST /sessions and switches (stored like any session).
Only the Messenger frame may send it, never while the app identifies its own
user. `session-update` announces `capabilities.adoptSession`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 18, 2026
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
The new "Verify email" workflow step (GleapSDK/Server#2385, GleapSDK/Messenger-App#263) can move a guest's conversation to the existing contact with that email. The widget must then continue as that contact, and the switch has to survive a reload.
What
GleapSession.adoptSession({gleapId, gleapHash}):POST /sessionswith those headers. The server only returns the session when the hash matches.validateSession, so the session is stored like any other and the frame gets the update, and bumpscontactVersionso an older in-flight answer can't switch back.lastIdentify.userId) or when it's already that session.GleapFrameManager:adopt-session, and only from the Messenger frame (never banners).session-updatenow carriescapabilities: { adoptSession: true }, so the widget knows it can ask.Native SDKs (iOS/Android) don't have this yet. There the widget falls back to switching for the current view only.
Verification
npm test571 pass;npm run buildcompiles. Build output reverted; the release build produces it.🤖 Generated with Claude Code