Skip to content

Commit

Permalink
Fix intent retry due to time sync error logic (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
BellringerQuinn authored Nov 4, 2024
1 parent 5bb1d63 commit 19dc2c9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,19 @@ public async Task<T> SendIntent<T, T2>(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)
{
Expand Down
2 changes: 1 addition & 1 deletion Packages/Sequence-Unity/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 19dc2c9

Please sign in to comment.