Repository navigation
feat: adopt the session the widget hands over (adopt-session) - #61
Merged
Merged
Conversation
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>
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.
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-sessionwith that contact'sgleapId/gleapHash.GleapFrameManagerViewController: newadopt-sessionmessage (behind the existing trusted-message check) →GleapSessionHelper adoptSessionWithId:hash:.adoptSessionWithId:hash:: POST/sessionswith 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 whosegleapIdmatches, throughupdateLocalSessionWith(stores gleapId/gleapHash, sends the usual session-update).session-updatecarriescapabilities: { adoptSession: true }. Without it the messenger falls back to switching only for the current view.No version bump, no release.
Verified:
xcodebuild test -scheme Gleapon 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