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

Trigger different events with different data for file vs. folder renames #558

Merged
merged 2 commits into from
Jul 13, 2016

Conversation

gideonthomas
Copy link

@gideonthomas gideonthomas commented Jul 6, 2016

This patch treats file renames and folder renames as different events.

  • With file renames, we trigger the fileRename event and send the old file path and the new file path (nothing has changed here)
  • With folder renames, we trigger the folderRename event and send only one object that contains the old folder path, the new folder path and an array of relative paths of files that live in the folder that is about to be renamed.

This will allow us to fix mozilla/thimble.mozilla.org#1311 and is part of a 3-piece patch (this patch depends on a patch in publish.wm.org landing first that adds a route for folder renames, then this patch should be landed along with the corresponding patch in thimble.mozilla.org). I haven't tested this yet since I'm waiting on another patch in publish to land first before I write the patch that will add the folder rename route...then I can test this.

@humphd r?

{
oldPath: "/path/before/rename",
newPath: "/path/after/rename",
// Paths to all files contained inside the folder being renamed
Copy link

Choose a reason for hiding this comment

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

s/files/child paths/ since it might also include folder names.

Copy link
Author

Choose a reason for hiding this comment

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

it won't include folder names since we explicitly ignore them

@humphd
Copy link

humphd commented Jul 7, 2016

This looks generally OK to me. A couple things I wasn't sure about listed in the PR. r=me

@humphd
Copy link

humphd commented Jul 12, 2016

This is good, r+

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.

Getting saving failed, retrying errors...
2 participants