ankitpokhrel / ankitpokhrel/tus-php
Deleting the cache entry inside the upload.complete event makes the completing request itself return 410
- 主要言語
- PHP
- スター
- 1.5k
- フォーク
- 220
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
**Version:** v2.4.0
## Summary
If a host application deletes the upload's cache entry from inside the `tus-server.upload.complete` event handler (a natural pattern for "consume the upload on completion" flows), the server's own post-event re-read of that entry causes the very request that just succeeded to respond **410 Gone** — the client is told its successful upload failed, and clients like Uppy surface an error for an upload that actually completed.
## Reproduce
1. Register a listener on `tus-server.upload.complete` that processes the finished file and then deletes the upload's cache entry (e.g. `$cache->delete($key)`).
2. Complete an upload (final PATCH).
3. The PATCH response is 410 instead of 204, despite the file having been fully received and the listener having run successfully.
## Workaround we use
Defer cache retirement until after the response object is built, within the same request.
## Suggested fix
Snapshot the file/cache state needed for the response before dispatching the completion event, or document that the cache entry must outlive the event handler.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。