From fe91493cd9fbdc4d89f46b3ea7b4a394facf712f Mon Sep 17 00:00:00 2001 From: martincostello Date: Wed, 11 Jun 2025 10:26:16 +0100 Subject: [PATCH] Copy job history Copy job history from storage before returning to avoid mutating state. --- src/Hangfire.MemoryStorage/MemoryStorageMonitoringApi.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Hangfire.MemoryStorage/MemoryStorageMonitoringApi.cs b/src/Hangfire.MemoryStorage/MemoryStorageMonitoringApi.cs index a531c36..ed59a8a 100644 --- a/src/Hangfire.MemoryStorage/MemoryStorageMonitoringApi.cs +++ b/src/Hangfire.MemoryStorage/MemoryStorageMonitoringApi.cs @@ -147,7 +147,7 @@ public JobDetailsDto JobDetails(string jobId) CreatedAt = job.CreatedAt, ExpireAt = job.ExpireAt, Job = DeserializeJob(job.InvocationData, job.Arguments), - History = job.History, + History = job.History.ToList(), Properties = jobParameters }; }