From 9071d0bf37ea02cd681c68d901cb6fc2f33e8c2f Mon Sep 17 00:00:00 2001 From: Robert Paciorek Date: Sat, 16 Sep 2023 18:05:39 +0000 Subject: [PATCH] fix some race conditions - use session lock for SetKeyValuePair* endpoints - use session lock for SetAchievementByEntityIDs endpoints --- src/Controllers/Common/AchievementController.cs | 2 +- src/Controllers/Common/ContentController.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Controllers/Common/AchievementController.cs b/src/Controllers/Common/AchievementController.cs index 758cbcf..268fee4 100644 --- a/src/Controllers/Common/AchievementController.cs +++ b/src/Controllers/Common/AchievementController.cs @@ -179,7 +179,7 @@ public class AchievementController : Controller { [HttpPost] [Produces("application/xml")] [Route("AchievementWebService.asmx/SetAchievementByEntityIDs")] - [VikingSession] + [VikingSession(UseLock=true)] public IActionResult SetAchievementByEntityIDs(Viking viking, [FromForm] int achievementID, [FromForm] string petIDs) { Guid[] petGuids = XmlUtil.DeserializeXml(petIDs); diff --git a/src/Controllers/Common/ContentController.cs b/src/Controllers/Common/ContentController.cs index 3da1a43..6c41415 100644 --- a/src/Controllers/Common/ContentController.cs +++ b/src/Controllers/Common/ContentController.cs @@ -115,7 +115,7 @@ public class ContentController : Controller { [Produces("application/xml")] [Route("ContentWebService.asmx/SetKeyValuePair")] [Route("ContentWebService.asmx/SetKeyValuePairByUserID")] - [VikingSession(Mode=VikingSession.Modes.VIKING_OR_USER)] + [VikingSession(Mode=VikingSession.Modes.VIKING_OR_USER, UseLock=true)] public IActionResult SetKeyValuePairByUserID(User? user, Viking? viking, [FromForm] int pairId, [FromForm] string contentXML, [FromForm] string? userId) { Schema.PairData schemaData = XmlUtil.DeserializeXml(contentXML);