fix(email): preserve draft send identity
CI and Deploy / test (pull_request) Successful in 4m15s
CI and Deploy / deploy (pull_request) Has been skipped

Persist and export each draft's idempotency UUID so refresh and edits cannot create a fresh delivery identity. Add reversible provider-specific migration SQL.
This commit is contained in:
cesnimda
2026-08-10 10:11:04 +02:00
parent 108440d361
commit 80b5532c2f
12 changed files with 2778 additions and 4 deletions
@@ -154,6 +154,7 @@ public sealed class BackgroundWorkerTenantTests
var draft = Assert.Single(rootElement.GetProperty("EmailDrafts").EnumerateArray());
Assert.Equal(owner == "user-1" ? "one@example.test" : "two@example.test", draft.GetProperty("To").GetString());
Assert.Equal(owner == "user-1" ? "Private draft one" : "Private draft two", draft.GetProperty("BodyText").GetString());
Assert.True(Guid.TryParse(draft.GetProperty("ClientRequestId").GetString(), out _));
Assert.Equal(1, draft.GetProperty("Revision").GetInt64());
}
owners.Sort(StringComparer.Ordinal);
@@ -176,6 +177,7 @@ public sealed class BackgroundWorkerTenantTests
Subject = "Synthetic export subject",
BodyText = body,
ThreadId = "synthetic-thread",
ClientRequestId = Guid.NewGuid().ToString("D"),
CreatedAtUtc = DateTime.UtcNow.AddMinutes(-5),
UpdatedAtUtc = DateTime.UtcNow,
};