Skip to content

memory: fix incorrect list entries when rooted at subdirectory - #7688

Merged
nielash merged 1 commit into
rclone:masterfrom
nielash:fix-memory-paths
Mar 27, 2024
Merged

nielash merged 1 commit into
rclone:masterfrom
nielash:fix-memory-paths

Conversation

@nielash

@nielash nielash commented Mar 24, 2024

Copy link
Copy Markdown
Contributor

What is the purpose of this change?

Before this change, List would return incorrect directory paths (relative to the wrong root) if the Fs root pointed to a subdirectory. For example, listing dir a/b/c/d of remote :memory: would work correctly, but listing dir c/d of remote :memory:a/b would not, and would result in Entry doesn't belong in directory %q (contains subdir) errors.

This change fixes the issue and adds a test to detect any other backends that might have the same issue.

Was the change discussed in an issue or in the forum before?

No.

Checklist

  • I have read the contribution guidelines.
  • I have added tests for all changes in this PR if appropriate.
  • I have added documentation for the changes if appropriate.
  • All commit messages are in house style.
  • I'm done, this Pull Request is ready for review :-)

@nielash nielash added this to the v1.67 milestone Mar 24, 2024
@nielash
nielash marked this pull request as ready for review March 24, 2024 11:48

@ncw ncw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good catch - well done :-)

See some inline comments about the tests.

Thank you.

Comment thread fstest/fstests/fstests.go Resolved
Comment thread fstest/fstests/fstests.go Resolved
Before this change, List would return incorrect directory paths (relative to the
wrong root) if the Fs root pointed to a subdirectory. For example, listing dir
"a/b/c/d" of remote :memory: would work correctly, but listing dir "c/d" of
remote :memory:a/b would not, and would result in "Entry doesn't belong in
directory %q (contains subdir)" errors.

This change fixes the issue and adds a test to detect any other backends that
might have the same issue.
nielash added a commit to nielash/rclone that referenced this pull request Mar 27, 2024
This change officially adds bisync to the nightly integration tests for all
backends.

This will be part of giving us the confidence to take bisync out of beta.

A number of fixes have been added to account for features which can differ on
different backends -- for example, hash types / modtime support, empty
directories, unicode normalization, and unimportant differences in log output.
We will likely find that more of these are needed once we start running these
with the full set of remotes.

Additionally, bisync's extremely sensitive tests revealed a few bugs in other
backends that weren't previously covered by other tests. Fixes for those issues
have been submitted on the following separate PRs (and bisync test failures will
be expected until they are merged):

- rclone#7670 memory: fix deadlock in operations.Purge
- rclone#7688 memory: fix incorrect list entries when rooted at subdirectory
- rclone#7690 memory: fix dst mutating src after server-side copy
- rclone#7692 dropbox: fix chunked uploads when size <= chunkSize

Relatedly, workarounds have been put in place for the following backend
limitations that are unsolvable for the time being:

- rclone#3262 drive is sometimes aware of trashed files/folders when it shouldn't be
- rclone#6199 dropbox can't handle emojis and certain other characters
- rclone#4590 onedrive API has longstanding bug for conflictBehavior=replace in
	server-side copy/move
nielash added a commit that referenced this pull request Mar 27, 2024
This change officially adds bisync to the nightly integration tests for all
backends.

This will be part of giving us the confidence to take bisync out of beta.

A number of fixes have been added to account for features which can differ on
different backends -- for example, hash types / modtime support, empty
directories, unicode normalization, and unimportant differences in log output.
We will likely find that more of these are needed once we start running these
with the full set of remotes.

Additionally, bisync's extremely sensitive tests revealed a few bugs in other
backends that weren't previously covered by other tests. Fixes for those issues
have been submitted on the following separate PRs (and bisync test failures will
be expected until they are merged):

- #7670 memory: fix deadlock in operations.Purge
- #7688 memory: fix incorrect list entries when rooted at subdirectory
- #7690 memory: fix dst mutating src after server-side copy
- #7692 dropbox: fix chunked uploads when size <= chunkSize

Relatedly, workarounds have been put in place for the following backend
limitations that are unsolvable for the time being:

- #3262 drive is sometimes aware of trashed files/folders when it shouldn't be
- #6199 dropbox can't handle emojis and certain other characters
- #4590 onedrive API has longstanding bug for conflictBehavior=replace in
	server-side copy/move

@ncw ncw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM thank you :-)

@nielash
nielash merged commit f62e7b5 into rclone:master Mar 27, 2024
lafkpages pushed a commit to lafkpages/rclone that referenced this pull request Jul 20, 2026
This change officially adds bisync to the nightly integration tests for all
backends.

This will be part of giving us the confidence to take bisync out of beta.

A number of fixes have been added to account for features which can differ on
different backends -- for example, hash types / modtime support, empty
directories, unicode normalization, and unimportant differences in log output.
We will likely find that more of these are needed once we start running these
with the full set of remotes.

Additionally, bisync's extremely sensitive tests revealed a few bugs in other
backends that weren't previously covered by other tests. Fixes for those issues
have been submitted on the following separate PRs (and bisync test failures will
be expected until they are merged):

- rclone#7670 memory: fix deadlock in operations.Purge
- rclone#7688 memory: fix incorrect list entries when rooted at subdirectory
- rclone#7690 memory: fix dst mutating src after server-side copy
- rclone#7692 dropbox: fix chunked uploads when size <= chunkSize

Relatedly, workarounds have been put in place for the following backend
limitations that are unsolvable for the time being:

- rclone#3262 drive is sometimes aware of trashed files/folders when it shouldn't be
- rclone#6199 dropbox can't handle emojis and certain other characters
- rclone#4590 onedrive API has longstanding bug for conflictBehavior=replace in
	server-side copy/move
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants