From 19dc2c9deac15def4a0b7c162f8e7845466f862e Mon Sep 17 00:00:00 2001 From: Quinn Purdy <49766546+BellringerQuinn@users.noreply.github.com> Date: Mon, 4 Nov 2024 11:30:54 -0500 Subject: [PATCH] Fix intent retry due to time sync error logic (#198) --- .../SequenceSDK/EmbeddedWallet/IntentSender.cs | 15 +++++++++++++-- Packages/Sequence-Unity/package.json | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Packages/Sequence-Unity/Sequence/SequenceSDK/EmbeddedWallet/IntentSender.cs b/Packages/Sequence-Unity/Sequence/SequenceSDK/EmbeddedWallet/IntentSender.cs index 25732a7b..c5cc5095 100644 --- a/Packages/Sequence-Unity/Sequence/SequenceSDK/EmbeddedWallet/IntentSender.cs +++ b/Packages/Sequence-Unity/Sequence/SequenceSDK/EmbeddedWallet/IntentSender.cs @@ -65,8 +65,19 @@ public async Task SendIntent(T2 args, IntentType type, uint timeBefore throw; } - IntentPayload intent = intentPayload as IntentPayload; - long currentTimeAccordingToIntent = intent.issuedAt; + long currentTimeAccordingToIntent = 0; + if (intentPayload is IntentPayload intent) + { + currentTimeAccordingToIntent = intent.issuedAt; + } + else if (intentPayload is RegisterSessionIntent registerSessionIntent) + { + currentTimeAccordingToIntent = registerSessionIntent.intent.issuedAt; + } + else + { + Debug.LogError("Unexpected intent payload type: " + intentPayload.GetType()); + } if (currentTimeAccordingToServer > currentTimeAccordingToIntent + 1 || currentTimeAccordingToServer < currentTimeAccordingToIntent - 1) { diff --git a/Packages/Sequence-Unity/package.json b/Packages/Sequence-Unity/package.json index b05f8581..a6d02092 100644 --- a/Packages/Sequence-Unity/package.json +++ b/Packages/Sequence-Unity/package.json @@ -1,6 +1,6 @@ { "name": "xyz.0xsequence.waas-unity", - "version": "3.11.0", + "version": "3.11.1", "displayName": "Sequence Embedded Wallet SDK", "description": "A Unity SDK for the Sequence WaaS API", "unity": "2021.3",