From 61653851dba79564391b7fa263eaa8f50d08baf8 Mon Sep 17 00:00:00 2001 From: tudor <7089284+tudddorrr@users.noreply.github.com> Date: Mon, 16 Jun 2025 20:23:40 +0100 Subject: [PATCH] continuity GET requests shouldn't be replayed --- Assets/Talo Game Services/Talo/Runtime/APIs/BaseAPI.cs | 2 +- .../Talo/Runtime/Utils/ContinuityManager.cs | 4 +++- .../Talo/Samples/Playground/Scenes/Playground.unity | 5 +---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Assets/Talo Game Services/Talo/Runtime/APIs/BaseAPI.cs b/Assets/Talo Game Services/Talo/Runtime/APIs/BaseAPI.cs index 00fc952..e86a3dd 100644 --- a/Assets/Talo Game Services/Talo/Runtime/APIs/BaseAPI.cs +++ b/Assets/Talo Game Services/Talo/Runtime/APIs/BaseAPI.cs @@ -97,7 +97,7 @@ protected async Task Call( } else { - if (www.responseCode >= 500 || www.result != UnityWebRequest.Result.ProtocolError) + if (www.responseCode > 500 || www.result != UnityWebRequest.Result.ProtocolError) { Talo.Continuity.PushRequest(uri, method, content, headers, continuityTimestamp); } diff --git a/Assets/Talo Game Services/Talo/Runtime/Utils/ContinuityManager.cs b/Assets/Talo Game Services/Talo/Runtime/Utils/ContinuityManager.cs index 3bed296..450b1e3 100644 --- a/Assets/Talo Game Services/Talo/Runtime/Utils/ContinuityManager.cs +++ b/Assets/Talo Game Services/Talo/Runtime/Utils/ContinuityManager.cs @@ -62,9 +62,11 @@ public bool HasRequests() public void PushRequest(Uri uri, string method, string content, List headers, long timestamp) { if (!Talo.Settings.continuityEnabled) return; - if (Array.Exists(_excludedEndpoints, (e) => uri.AbsolutePath.Contains(e))) return; + var allowedMethods = new[] { "POST", "PUT", "PATCH", "DELETE" }; + if (!Array.Exists(allowedMethods, (m) => m == method)) return; + _requests.Add(new Request { uri = uri.ToString(), diff --git a/Assets/Talo Game Services/Talo/Samples/Playground/Scenes/Playground.unity b/Assets/Talo Game Services/Talo/Samples/Playground/Scenes/Playground.unity index 980a641..a8ad0f5 100644 --- a/Assets/Talo Game Services/Talo/Samples/Playground/Scenes/Playground.unity +++ b/Assets/Talo Game Services/Talo/Samples/Playground/Scenes/Playground.unity @@ -2006,9 +2006,7 @@ MonoBehaviour: m_HorizontalOverflow: 0 m_VerticalOverflow: 0 m_LineSpacing: 1 - m_Text: 'Identify - -' + m_Text: Identify --- !u!222 &828856313 CanvasRenderer: m_ObjectHideFlags: 0 @@ -5067,7 +5065,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 97878412af55348cd93fdd4ef8ecf7e5, type: 3} m_Name: m_EditorClassIdentifier: - statInternalName: --- !u!1 &1989410050 GameObject: m_ObjectHideFlags: 0