-
Notifications
You must be signed in to change notification settings - Fork 45
Remove storage entry if resumable storage has been enabled and the stored URL has been voided #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thank you very much for opening this PR! |
7b61530
to
314c06b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much. The test logic looks good now, but CI is failing on Windows due to PermissionError: [Errno 13] Permission denied: 'C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\tmpevpkhklg'
. Can you please have a look at this?
https://docs.python.org/3/library/tempfile.html#tempfile.NamedTemporaryFile /windows seems related. |
314c06b
to
997d60a
Compare
I noticed earlier with named temporary folders. Perhaps it's the use of context manager that messes up with windows logic. 3.12 introduces Nevertheless, I updated the test to not rely on context manager. If this also fails then only thing left is to create a file during test runtime within tests-folder, like how it was done in test_filestorage.py -module. |
I just ran CI tests again, but unfortunately it didn't seem to help so far. |
997d60a
to
d4a5e1b
Compare
My last attempt before I ditch |
python/cpython#88221 (comment) But as @pandabear stated, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Looks all good now!
This pull request aims to resolve the issue #103 .
This change introduces a logic handler when initializing a new Uploader instance with storage-enabled to not only clean up voided storage key entry, but also make the usage more user-friendly as no extra effort is required to initialize a resumable feature. tus-js-client was referenced https://github.com/tus/tus-js-client/blob/bef505f2fb751095af06e3a9bdf62384df136a7a/lib/upload.ts#L697-L705 to determine how this case is handled. Otherwise retain the same logic as before.