[SYNPY-1557] Sync a Linked Folder Bug #1157
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
A user recently reported unexpected behavior when using the following command:
The folder being recursively downloaded (synced) contained a link to another Synapse folder, and an error was being thrown:
In short, the Synapse client was unable to properly mirror the folder structure with a linked folder in it. We would expect that linked folder to be created as a subfolder containing the files that it does on Synapse.
In order to enable this behavior, I first wrote an integration test to check that the client was giving the desired behavior in this situation with the expectation that the test would throw the same error until a fix was implemented. Then, I dug into the code and discovered that in
_follow_link
, we were previously not tracking the target name for the linked entity, which was causing a locally created folder mirroring the linked Synapse folder not to be created by the child task, resulting in the error. After adding that tracking (passing thename
on to_create_task_for_child
) within_follow_link
, the test passed and I was able to successfully sync the folder from the original user report.Previous behavior for syncing "normal" child folders and files was not adversely effected by the change. I tested this manually on my own test project, on the location reported by the user, and through ensuring that the existing integration tests still pass.