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

Bust cache for draft files when file exists on S3 #3052

Merged
merged 2 commits into from
May 8, 2024
Merged

Conversation

nellh
Copy link
Contributor

@nellh nellh commented May 8, 2024

Fixes #3047. This cache was created with the key "HEAD" and the cached value would be returned if the file existed on S3. Instead this caches the draft with the commit hash. This does mean an extra worker API call for each file during a download, so added a short lived cache to avoid bulk file requests from repeating this request to the worker.

Copy link

codecov bot commented May 8, 2024

Codecov Report

Attention: Patch coverage is 16.66667% with 15 lines in your changes are missing coverage. Please review.

Project coverage is 42.48%. Comparing base (cd5c1e0) to head (7cee72f).
Report is 2 commits behind head on master.

Files Patch % Lines
packages/openneuro-server/src/datalad/draft.ts 15.38% 11 Missing ⚠️
packages/openneuro-server/src/handlers/datalad.ts 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3052      +/-   ##
==========================================
- Coverage   42.48%   42.48%   -0.01%     
==========================================
  Files         601      601              
  Lines       37971    37980       +9     
  Branches     1113     1113              
==========================================
+ Hits        16131    16134       +3     
- Misses      21624    21630       +6     
  Partials      216      216              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@effigies
Copy link
Contributor

effigies commented May 8, 2024

Makes sense to me.

@nellh nellh merged commit edd8c62 into master May 8, 2024
8 of 11 checks passed
@nellh nellh deleted the 3047-draft-cache-fix branch May 8, 2024 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Viewing participants.tsv in draft shows old versions of file
2 participants