AB-Law / AB-Law/Pluck-It

WardrobeRepository.cs: Stale image cleanup index after partial write in SetDraftTerminalAsync

Ouverte
#98 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
bug performance
Langage dominant
TypeScript
Étoiles
0
Forks
0
Merge moyen
16 min
PR mergées (30 j)
1

Description

## Problem

`PluckIt.Infrastructure/WardrobeRepository.cs:387-405` patches the wardrobe item first, then calls `SyncImageCleanupIndexAsync`. If the second call fails, the item is updated but the cleanup index is stale — orphaned image URLs will never be collected.

```csharp
await _container.PatchItemAsync(...); // Step 1: succeeds
await SyncImageCleanupIndexAsync(response.Resource, ct); // Step 2: can fail silently
return true;
```

## Impact

Orphaned blobs accumulate in Azure Storage; the daily cleanup misses them; storage costs grow unbounded.

## Proposed Fix

Wrap `SyncImageCleanupIndexAsync` in a try/catch that logs a warning on failure, and introduce a background reconciliation sweep (e.g., via change feed) to detect and fix stale index entries.

## Functionality Impact

No functional change for users; improves cleanup reliability and reduces storage costs over time.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.