fix(infra): repair TransferFiles compensation + tidy MassTransit consistency

Fix (recoverability bug):
- TransferFilesToBucketActivity returned Completed() with no log, so its
  compensation could never delete the transferred files (orphaned objects on
  fault). IStorageService.TransferFilesAsync now returns the real uploaded
  keys; the activity logs them so Compensate can remove them. Also drops the
  Path.Combine key recomputation (produced backslash keys on Windows).

Consistency / DRY:
- Normalize all courier activities to internal + folder-based namespaces
  (several were public and in the flat .Activities namespace)
- Extract the duplicated exponential retry into UseStandardRetry
- Unify endpoint-name logic into a single EndpointHelper (remove the parallel
  MassTransitEndpointNames helper)

Build: 0 warnings, 0 errors.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-05 04:58:27 +02:00
co-authored by Claude Opus 4.8
parent 423e06baf9
commit d08d82a483
15 changed files with 49 additions and 71 deletions
@@ -2,10 +2,14 @@ namespace Musify.Infrastructure.MassTransit.Consumers
{
internal static class EndpointHelper
{
internal static Uri BuildExecuteActivityUri(string endpointName) => new($"queue:{endpointName}_execute");
internal static string ExecuteQueueName(string endpointName) => $"{endpointName}_execute";
internal static Uri BuildCompensateActivityUri(string endpointName) => new($"queue:{endpointName}_compensate");
internal static string CompensateQueueName(string endpointName) => $"{endpointName}_compensate";
internal static Uri BuildExecuteActivityUri(string endpointName) => new($"queue:{ExecuteQueueName(endpointName)}");
internal static Uri BuildCompensateActivityUri(string endpointName) => new($"queue:{CompensateQueueName(endpointName)}");
internal static Uri BuildConsumerUri(string endpointName) => new($"queue:{endpointName}");
}
}
}