From 4531555bd65f7ed412a63802109e917ae07d28f8 Mon Sep 17 00:00:00 2001 From: stidsborg Date: Sun, 9 Aug 2026 10:33:40 +0200 Subject: [PATCH] Remove the unused StoredInputOutput type The record had no live consumers: its only producer - the PostgreSQL SqlGenerator's ReadStoredFunction - was itself uncalled, and ToStoredFlow had no callers either. Delete both. --- .../Storage/Types.cs | 28 +----------------- .../SqlGenerator.cs | 29 ------------------- 2 files changed, 1 insertion(+), 56 deletions(-) diff --git a/Core/Cleipnir.ResilientFunctions/Storage/Types.cs b/Core/Cleipnir.ResilientFunctions/Storage/Types.cs index e3a5d1ec2..631fcadba 100644 --- a/Core/Cleipnir.ResilientFunctions/Storage/Types.cs +++ b/Core/Cleipnir.ResilientFunctions/Storage/Types.cs @@ -195,30 +195,4 @@ public static Task ResolveResultType(this StoredEffect effect, TypeMapper => typeMapper.ResolveType(effect.ResultType!.Value); } -public record StoredReplica(ReplicaId ReplicaId, long LatestHeartbeat); - -public record StoredInputOutput( - StoredId Id, - byte[]? ParamJson, - byte[]? ResultJson, - string? ExceptionJson, - string HumanInstanceId, - StoredId? Parent -) -{ - public StoredFlow ToStoredFlow(Status status, long expires, long timestamp, ReplicaId owner) - { - return new StoredFlow( - Id, - HumanInstanceId, - ParamJson, - status, - ExceptionJson != null ? StoredException.Deserialize(ExceptionJson) : null, - expires, - timestamp, - Parent, - owner, - Id.Type - ); - } -}; \ No newline at end of file +public record StoredReplica(ReplicaId ReplicaId, long LatestHeartbeat); \ No newline at end of file diff --git a/Stores/PostgreSQL/Cleipnir.ResilientFunctions.PostgreSQL/SqlGenerator.cs b/Stores/PostgreSQL/Cleipnir.ResilientFunctions.PostgreSQL/SqlGenerator.cs index e817cea6d..220f071e7 100644 --- a/Stores/PostgreSQL/Cleipnir.ResilientFunctions.PostgreSQL/SqlGenerator.cs +++ b/Stores/PostgreSQL/Cleipnir.ResilientFunctions.PostgreSQL/SqlGenerator.cs @@ -17,35 +17,6 @@ namespace Cleipnir.ResilientFunctions.PostgreSQL; public class SqlGenerator(string tablePrefix) { - public async Task ReadStoredFunction(NpgsqlDataReader reader) - { - /* - 0 id - 1 param - 2 result - 3 exception - 4 human_instance_id - 5 parent - */ - while (await reader.ReadAsync()) - { - var id = reader.GetGuid(0).ToStoredId(); - var hasParam = !await reader.IsDBNullAsync(1); - var hasResult = !await reader.IsDBNullAsync(2); - var hasException = !await reader.IsDBNullAsync(3); - var hasParent = !await reader.IsDBNullAsync(5); - - var paramJson = hasParam ? (byte[])reader.GetValue(1) : null; - var resultJson = hasResult ? (byte[])reader.GetValue(2) : null; - var exceptionJson = hasException ? reader.GetString(3) : null; - var humanInstanceId = reader.GetString(4); - var parent = hasParent ? reader.GetGuid(5).ToStoredId() : null; - - return new StoredInputOutput(id, paramJson, resultJson, exceptionJson, humanInstanceId, parent); - } - - return null; - } public StoreCommand InsertEffects(StoredId storedId, IReadOnlyList changes, SnapshotStorageSession session) { foreach (var change in changes)