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 getNodeForPath caching #1545

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

icewind1991
Copy link
Contributor

The change #1060 from the recursive to iterative getNodeForPath means that any cached parent node isn't used anymore.

This adds some logic to find the nearest parent that is cached and start the iterative logic from there.

Copy link

codecov bot commented Feb 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (97129a9) 97.22% compared to head (1434739) 97.24%.
Report is 3 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1545      +/-   ##
============================================
+ Coverage     97.22%   97.24%   +0.01%     
- Complexity     2834     2835       +1     
============================================
  Files           175      175              
  Lines          9018     8849     -169     
============================================
- Hits           8768     8605     -163     
+ Misses          250      244       -6     

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

@patrickTUD
Copy link

@icewind1991 - you rock! See nextcloud/server#42143

@ingeniumnrsp
Copy link

For those that don't have root access to their NC installs, which version can we expect the fix to arrive in?

Thanks!

$node = $this->rootNode;

// look for any cached parent and collect the parts below the parent
$parts = [];
$remainingPath = $path;
Copy link
Contributor

Choose a reason for hiding this comment

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

Note: we know that $path is not the empty string, because of the check a few lines above.
So the call to Uri\split() below will always pass a non-empty string.
So we don't have to worry about the fact that Uri\split returns [null, null] when passed and empty string.

Just noting this, because I saw that Uri\split can return [null, null] and I was concerned about that - it would cause it to be called again with null and explode.

Copy link
Contributor

@phil-davis phil-davis left a comment

Choose a reason for hiding this comment

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

LGTM

@phil-davis
Copy link
Contributor

@staabm @DeepDiver1975 any comment? or merge and release?

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

4 participants