pingdotgg / uploadthing

File uploads for modern web devs
https://uploadthing.com
MIT License
3.95k stars 285 forks source link

[Bug]: `UTApi` is deleting the file but still able to directly access the file from its URL. #884

Closed Abdullahiqbal2021 closed 1 month ago

Abdullahiqbal2021 commented 1 month ago

What happened?

I am using UTApi to delete my uploaded images. The images are deleted successfully and no longer appear in the dashboard. However, I can still directly access the deleted file from its previously stored URL.

It also frees up space for my free tier. 🙂

What did you expect to happen?

The file should not be accessible via its URL after deletion.

Version

Using "@uploadthing/react": "^6.7.2", "uploadthing": "^6.13.2"

Reproduction Steps

Just follow your docs

Relevant log output

No response

Code of Conduct

markflorkowski commented 1 month ago

@Abdullahiqbal2021 can you share your appId and an example of an affected file key ? I have not been able to reproduce this behavior on my end.

Abdullahiqbal2021 commented 1 month ago

@markflorkowski this is the repo i am working on and created a simple page to recreate issue. My UPLOADTHING_APP_ID is

2bf2bglzre

and affected file is

#key
ac0595d4-1ff4-48ac-946a-bf45a964b007-bjnd11.png

#URL
https://utfs.io/f/ac0595d4-1ff4-48ac-946a-bf45a964b007-bjnd11.png

I am currently using Chrome. I thought it was some cache issue but i open the image link in firefox and was able to access the image.

The image seems to be deleted as it does not appear in dashboard any more but we can access it directly from its stored url.

Abdullahiqbal2021 commented 1 month ago

@markflorkowski I just access the above URL and file is not accessible. I think it take some time to delete the file but the file disappears from the dashboard immediately.

markflorkowski commented 1 month ago

I think it take some time to delete the file but the file disappears from the dashboard immediately.

Yes, this is correct. We optimistically remove it from the dashboard, but in reality it can take probably up to 30 seconds for the file to actually be fully removed.

Abdullahiqbal2021 commented 1 month ago

I think it take some time to delete the file but the file disappears from the dashboard immediately.

Yes, this is correct. We optimistically remove it from the dashboard, but in reality it can take probably up to 30 seconds for the file to actually be fully removed.

Thanks 👍