Fix deletion of partially-uploaded (pending) files#11655
Fix deletion of partially-uploaded (pending) files#11655
Conversation
Agent-Logs-Url: https://github.com/appwrite/appwrite/sessions/8d14b17a-78d8-48c6-b6d8-51d9697adde0 Co-authored-by: Meldiron <19310830+Meldiron@users.noreply.github.com>
🔄 PHP-Retry SummaryFlaky tests detected across commits: Commit
|
| Test | Retries | Total Time | Details |
|---|---|---|---|
UsageTest::testVectorsDBStats |
1 | 10.14s | Logs |
LegacyCustomClientTest::testListIndexes |
1 | 240.48s | Logs |
LegacyCustomServerTest::testAttributeResponseModels |
1 | 242.87s | Logs |
Commit b2b187c - 6 flaky tests
| Test | Retries | Total Time | Details |
|---|---|---|---|
UsageTest::testPrepareStorageStats |
1 | 1.71s | Logs |
DocumentsDBConsoleClientTest::testTimeout |
1 | 120.05s | Logs |
DocumentsDBCustomServerTest::testTimeout |
1 | 120.59s | Logs |
LegacyConsoleClientTest::testAttributeResponseModels |
1 | 240.85s | Logs |
LegacyCustomServerTest::testOneToOneRelationship |
1 | 240.11s | Logs |
LegacyCustomServerTest::testTimeout |
1 | 123.25s | Logs |
Commit 71e714c - 4 flaky tests
| Test | Retries | Total Time | Details |
|---|---|---|---|
LegacyCustomClientTest::testManyToManyRelationship |
1 | 1.36s | Logs |
LegacyCustomServerTest::testListDocumentsWithCache |
1 | 713ms | Logs |
LegacyTransactionsConsoleClientTest::testMixedSingleOperations |
1 | 240.75s | Logs |
UsageTest::testVectorsDBStats |
1 | 10.02s | Logs |
Greptile SummaryThis PR fixes a server error that occurred when deleting a file whose chunked upload was cancelled before any bytes were written to disk. The root cause was that The fix wraps the Key points:
Confidence Score: 4/5Safe to merge for Local storage deployments; the broad exception catch warrants a follow-up for cloud storage adapters but is not a blocker. The core fix is correct and well-targeted for the described bug. The exception type thrown by the Local device (\Exception) matches what is caught. The e2e test exercises the fixed path end-to-end. The one concrete concern — that catch (\Exception) silently swallows unexpected errors from cloud storage adapters — is a real edge case but not likely to cause problems in normal usage for the majority of deployments. P2 test hygiene issues do not affect merge safety. src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Delete.php — review the exception catch breadth if cloud storage adapters are a primary concern. Important Files Changed
Reviews (1): Last reviewed commit: "fix: allow deletion of partially-uploade..." | Re-trigger Greptile |
src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Delete.php
Outdated
Show resolved
Hide resolved
✨ Benchmark results
⚡ Benchmark Comparison
|
This comment has been minimized.
This comment has been minimized.
|
@copilot Address two reviews above, I pinged you in both |
Agent-Logs-Url: https://github.com/appwrite/appwrite/sessions/045e63f6-9a81-447b-ba79-7391ab97fb01 Co-authored-by: Meldiron <19310830+Meldiron@users.noreply.github.com>
Done in ecc76c7:
|
| // If the partial upload chunks are already gone from the device | ||
| // (e.g. the upload never wrote anything to disk), treat it as deleted | ||
| // so the pending file document can still be removed from the database. | ||
| $log->addTag('abortException', $e->getMessage()); |
There was a problem hiding this comment.
Not sure if we really want to add this...
There was a problem hiding this comment.
Since we catch all exceptions, we could be catching unwanted ones too, very hard to tell right now.
I want to keep this, but agree this maybe shouldnt be in log itself. moving it to span instead.
Fixes: SER-1179
abort()exception propagation for partially-uploaded files inDelete.phpLog $logand capture exception as$eto surface unexpectedabort()failures via$log->addTag('abortException', $e->getMessage())StorageBase.php@error-suppression operators fromfopen/fread/fclose; add explicit assertion that file handle is validtestDeletePartiallyUploadedFileto avoid leftover state across test runs📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.