Skip to content
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

Keep single-use routes for a few seconds before pruning them #4219

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

falkoschindler
Copy link
Contributor

As discussed in issue #4016, ui.download can fail on the auto-index page if multiple tabs try to download from a single-use route at the same time. The first download will remove the route and subsequent downloads will fail.

This PR addresses this problem by keeping used single-use routes in a dictionary with an expiration timestamp. A pruning loop will check this dictionary every 10 seconds and remove outdated routes.

Note that simply delaying the removal after creating a single-use route did not work. The path of a single-use route is basically a hash of the filepath and, thus, not unique to a single call to ui.download. Therefore a route could be used again and again, so we need to keep it as long as ui.download is still being called.

@falkoschindler falkoschindler added the bug Something isn't working label Jan 14, 2025
@falkoschindler falkoschindler added this to the 2.10 milestone Jan 14, 2025
@falkoschindler falkoschindler requested a review from rodja January 14, 2025 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant