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

fix(cache): don't use _originalPath #1576

Merged
merged 2 commits into from
Aug 15, 2023
Merged

fix(cache): don't use _originalPath #1576

merged 2 commits into from
Aug 15, 2023

Conversation

danielroe
Copy link
Member

πŸ”— Linked issue

Dropped in unjs/h3#506

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

I think caching on path probably makes sense but we could also use event.node.req.originalUrl || event.node.req.url || to match current behaviour.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

src/runtime/cache.ts Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Aug 15, 2023

Codecov Report

Merging #1576 (c8250c0) into main (12d0e47) will decrease coverage by 0.06%.
Report is 2 commits behind head on main.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1576      +/-   ##
==========================================
- Coverage   76.00%   75.95%   -0.06%     
==========================================
  Files          74       74              
  Lines        7710     7710              
  Branches      760      760              
==========================================
- Hits         5860     5856       -4     
- Misses       1848     1851       +3     
- Partials        2        3       +1     

see 1 file with indirect coverage changes

Co-authored-by: Daniel Roe <daniel@roe.dev>
@pi0 pi0 changed the title fix: don't use _originalPath fix(cache): don't use _originalPath Aug 15, 2023
Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks ltgm. two notes:

  • We might later simplify caching strategy to use event.path only. Need to double check all places
  • Will also have to check why tests didn't caught it.

@pi0 pi0 merged commit 6af6fd1 into main Aug 15, 2023
9 checks passed
@pi0 pi0 deleted the fix/dropped-getter branch August 15, 2023 07:07
@danielroe
Copy link
Member Author

@pi0 pi0 mentioned this pull request Aug 21, 2023
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.

None yet

2 participants