You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FileExplorer: re-uploading a deleted file's content fails on the MD5 unique index #260
After a file is deleted, uploading a file with the same bytes to the same container always fails with a unique-constraint violation. Over HTTP this surfaces as a 500. Over MCP it comes back as kind: unknown, "An internal error occurred".
Meanwhile the dedup lookup (FindByMd5Async / Md5ExistsAsync) runs under ABP's soft-delete data filter, so it cannot see the deleted row. It finds nothing, the manager inserts a new descriptor with the same MD5, and the index rejects it. The deleted row keeps its MD5 slot for good.
Options
Exclude deleted rows from the indexes: add IsDeleted = 0 (EF) / IsDeleted: false (Mongo partial filter). This is the smallest semantic change. However, it alters an index that consuming hosts own the migrations for (EF), and the Mongo index has to be dropped and recreated, as RemoveLegacyMd5Index already does for the previous shape. Needs a CHANGELOG migration note.
Let dedup see soft-deleted rows, with the soft-delete filter disabled, and revive or re-point to the existing blob. This avoids an index change, but ties dedup to deleted data and to whether the blob still exists (the reference/orphan rules in the file-storing invariants §3–§4).
Hard-delete descriptors. This drops the soft-delete audit trail, so it is probably not wanted.
Option 1 looks right. Whatever the fix, invariant §3 also applies here: the database constraint is the arbiter, so a concurrent duplicate upload should be turned into a business error rather than a raw DbUpdateException.
Not fixed in the MCP work (#254, #259). Since #259, an MCP client at least gets a complete error response and the cause is logged.
Activity