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 directory handling issues under lazy loading #33

Merged
merged 2 commits into from
Oct 16, 2023

Conversation

zurcher
Copy link
Contributor

@zurcher zurcher commented Jun 21, 2023

  • Set the parent directory during populate_dirs (this is done in add_subdirectory() for non-lazy loading)
  • Don't repopulate the directory structure from disk when there is a pending entry change

@nathanhi nathanhi self-assigned this Jul 2, 2023
nathanhi
nathanhi previously approved these changes Jul 9, 2023
Copy link
Owner

@nathanhi nathanhi left a comment

Choose a reason for hiding this comment

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

Nice, thank you! I'll update the Pull Request later and will add some tests before merging.

@nioncode
Copy link

Any update on this? Without this, iterating the fs via walk() and printing file paths via file.get_full_path() is completely broken.

zurcher and others added 2 commits October 17, 2023 00:06
When lazy-loading an existing directory structure, the
parent directory entry reference is not properly set. This
leads to issues traversing a directory structure bottom up.
When updating a dentry (e.g., adding a new file), the parent
directory will be re-read from disk on lazy-loading. This
causes the pending change to be reverted, leading to missing
newly added files.

To fix this, the directory entries __dirs list will only
be populated once.
@nathanhi
Copy link
Owner

Any update on this? Without this, iterating the fs via walk() and printing file paths via file.get_full_path() is completely broken.

Sorry for the wait - I haven't quite had the time to properly write tests for this pull request before merging.

@nathanhi nathanhi merged commit 138aaee into nathanhi:master Oct 16, 2023
16 of 17 checks passed
@nathanhi nathanhi added the bug Something isn't working label Oct 16, 2023
This pull request was closed.
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.

3 participants