Skip to content

Commit 19dc2c9

Browse files
Fix intent retry due to time sync error logic (#198)
1 parent 5bb1d63 commit 19dc2c9

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

Packages/Sequence-Unity/Sequence/SequenceSDK/EmbeddedWallet/IntentSender.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,19 @@ public async Task<T> SendIntent<T, T2>(T2 args, IntentType type, uint timeBefore
6565
throw;
6666
}
6767

68-
IntentPayload intent = intentPayload as IntentPayload;
69-
long currentTimeAccordingToIntent = intent.issuedAt;
68+
long currentTimeAccordingToIntent = 0;
69+
if (intentPayload is IntentPayload intent)
70+
{
71+
currentTimeAccordingToIntent = intent.issuedAt;
72+
}
73+
else if (intentPayload is RegisterSessionIntent registerSessionIntent)
74+
{
75+
currentTimeAccordingToIntent = registerSessionIntent.intent.issuedAt;
76+
}
77+
else
78+
{
79+
Debug.LogError("Unexpected intent payload type: " + intentPayload.GetType());
80+
}
7081
if (currentTimeAccordingToServer > currentTimeAccordingToIntent + 1 ||
7182
currentTimeAccordingToServer < currentTimeAccordingToIntent - 1)
7283
{

Packages/Sequence-Unity/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "xyz.0xsequence.waas-unity",
3-
"version": "3.11.0",
3+
"version": "3.11.1",
44
"displayName": "Sequence Embedded Wallet SDK",
55
"description": "A Unity SDK for the Sequence WaaS API",
66
"unity": "2021.3",

0 commit comments

Comments
 (0)