Repository navigation
Support isolated SequenceLogin instances for dual sessions - #351
Open
tolgahan-arikan wants to merge 3 commits into
Open
tolgahan-arikan wants to merge 3 commits into
tolgahan-arikan wants to merge 3 commits into
Conversation
Adds SequenceLogin.CreateIsolatedInstance(namespace) so a second wallet session (e.g. an existing email account) can be authenticated while the default instance keeps the current guest session. - Isolated instances store their session under a namespaced secure storage key, raise per-instance OnSessionWalletCreated / OnSessionRecoveryFailed instead of the static SequenceWallet events, skip auto-federation and do not write the last-login PlayerPrefs. - PromoteToDefaultSession(wallet) moves the session to the default key, clears federation mode and raises SequenceWallet.OnWalletCreated so EmbeddedWalletAdapter / SessionManager switch to it. - ClearStoredSession() removes an instance's stored session. - SequenceWallet keeps its own session key and owning login; on account federation it persists its own key instead of the singleton's current session key. - Default GetInstance() behaviour is unchanged. Adds a batchmode verification harness (Assets/Editor/DualSessionVerification) that runs the guest + second-account flow across separate editor processes.
Deploying sequence-unity with
|
| Latest commit: |
f27f0c7
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e31f4ddd.sequence-unity.pages.dev |
| Branch Preview URL: | https://feature-dual-session-support.sequence-unity.pages.dev |
This branch has not been deployed
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.
Adds opt-in support for holding a second embedded-wallet session alongside the default one, so an existing account can be authenticated while the current guest wallet stays usable (TapNation guest-reward merge).
Related: 0xsequence/issue-tracker#7344, 0xsequence/issue-tracker#7348
Changes
SequenceLogin.CreateIsolatedInstance(string storageNamespace, ...): non-singleton instance.{company}-{product}-{namespace}-SessionWallet.OnSessionWalletCreated/OnSessionRecoveryFailed; does not raise the staticSequenceWallet.OnWalletCreated/OnFailedToRecoverSession, soEmbeddedWalletAdapterandSessionManagerstay on the default session.WaaSLoginMethod/LoginEmailPlayerPrefs.PromoteToDefaultSession(SequenceWallet): writes the session to the default key, clears the namespaced key, clears federation mode on the default instance, raisesSequenceWallet.OnWalletCreated. Closing the previous (guest) session stays with the caller, after transfers confirm.ClearStoredSession(): removes an instance's stored session.TryToRestoreSessionAsynclistens to the per-instance events (default instance still raises the static ones).SequenceWalletkeeps its session key and owning login. On account federation it persists its own key under its owner's namespace; previously it stored the singleton's current session key, which is wrong once two sessions exist.GetInstance()behaviour unchanged.Verification
Batchmode harness
Assets/Editor/DualSessionVerification(Unity 2022.3.62f2, dev WaaS, each phase a separate editor process; not NUnit becauseStoreSessionKey()disables storage during test runs):setup13/13,restart8/8,final2/2: guest on default + guest on isolated instance, backend sessions, storage keys, adapter/event isolation, transfer from guest, restore after restart, guest sign-out isolation, promotion, restore of promoted account.email-create2/2,email-merge15/15: guest live, existing email account authenticated on isolated instance, wrong OTP rejected without side effects, auth returns the existing wallet, transfer guest → existing wallet, guest closed, promotion, adapter switched.SequenceLoginTests,WaaSWalletUnitTests,InitiateEmailSignInUnitTests,WaaSToWalletAdapterUnitTests,IntentSenderTests,JwtHelperTests): 16/64 pass, identical per test tomaster(failures are environment/config).Not covered
Version Increment
Please ensure you have incremented the package version in the package.json as necessary.
Docs Checklist
Please ensure you have addressed documentation updates if needed as part of this PR: