diff --git a/Adaptors/Memory/src/TaskTable.cs b/Adaptors/Memory/src/TaskTable.cs index 4433b7556..b9e5553fb 100644 --- a/Adaptors/Memory/src/TaskTable.cs +++ b/Adaptors/Memory/src/TaskTable.cs @@ -271,7 +271,7 @@ public Task RemoveRemainingDataDependenciesAsync(ICollection taskIds, { var remainingDep = data.RemainingDataDependencies; - foreach (var dep in dependenciesToRemove.Select(TaskData.EscapeKey)) + foreach (var dep in dependenciesToRemove) { remainingDep.Remove(dep); } diff --git a/Adaptors/MongoDB/src/TaskTable.cs b/Adaptors/MongoDB/src/TaskTable.cs index 50f2ef468..9823caf54 100644 --- a/Adaptors/MongoDB/src/TaskTable.cs +++ b/Adaptors/MongoDB/src/TaskTable.cs @@ -370,11 +370,11 @@ public async Task RemoveRemainingDataDependenciesAsync(ICollection taskI } - var key0 = TaskData.EscapeKey(deps.Current); + var key0 = deps.Current; var update = new UpdateDefinitionBuilder().Unset(data => data.RemainingDataDependencies[key0]); while (deps.MoveNext()) { - var key = TaskData.EscapeKey(deps.Current); + var key = deps.Current; update = update.Unset(data => data.RemainingDataDependencies[key]); } diff --git a/Common/src/Storage/TaskData.cs b/Common/src/Storage/TaskData.cs index d80429b37..03fd9537f 100644 --- a/Common/src/Storage/TaskData.cs +++ b/Common/src/Storage/TaskData.cs @@ -18,7 +18,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; using ArmoniK.Core.Base.DataStructures; @@ -140,7 +139,7 @@ public TaskData(string sessionId, { payloadId, }) - .ToDictionary(EscapeKey, + .ToDictionary(s => s, _ => true), expectedOutputIds, taskId, @@ -175,23 +174,6 @@ public TaskData(TaskData original, : this(original) => updates.ApplyTo(this); - /// - /// ResultIds could contain dots (eg: it is the case in htcmock), - /// but MongoDB does not support well dots in keys. - /// This escapes the key to replace dots with something else. - /// Escaped keys are guaranteed to have neither dots nor dollars - /// - /// Key string - /// Escaped key - public static string EscapeKey(string key) - => new StringBuilder(key).Replace("@", - "@at@") - .Replace(".", - "@dot@") - .Replace("$", - "@dollar@") - .ToString(); - /// /// Conversion operator from to /// diff --git a/Common/tests/TestBase/TaskTableTestBase.cs b/Common/tests/TestBase/TaskTableTestBase.cs index 75749cfd8..c197133e5 100644 --- a/Common/tests/TestBase/TaskTableTestBase.cs +++ b/Common/tests/TestBase/TaskTableTestBase.cs @@ -2151,8 +2151,8 @@ public async Task RemoveRemainingDataDependenciesShouldSucceed() { var taskId = Guid.NewGuid() .ToString(); - var dd1 = "dependency.1"; - var dd2 = "dependency.2"; + var dd1 = "dependency1"; + var dd2 = "dependency2"; await TaskTable!.CreateTasks(new[] {