Skip to content

fix: rename and fetch_data progress report#12

Closed
ho-229 wants to merge 2 commits into
ok-nick:mainfrom
ho-229:fix/rename-and-fetchdata
Closed

fix: rename and fetch_data progress report#12
ho-229 wants to merge 2 commits into
ok-nick:mainfrom
ho-229:fix/rename-and-fetchdata

Conversation

@ho-229

@ho-229 ho-229 commented Jun 11, 2024

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread examples/sftp/src/main.rs Outdated
Comment thread examples/sftp/src/main.rs
Comment thread examples/sftp/src/main.rs
.unlink(&src.strip_prefix(&base).unwrap())
.map_err(|_| CloudErrorKind::InvalidRequest)?;
}
(false, true) => Err(CloudErrorKind::NotSupported)?, // TODO

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

What's wrong with the old impl w/ self.create_dir_all and self.create_file?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, it's simpler way.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I agree, a lot of the impl can be greatly simplified and probably replaced with a single call to fs::copy, but this functionality shouldn't be removed from the example.

Comment thread src/filter/proxy.rs
@ho-229

ho-229 commented Jun 14, 2024

Copy link
Copy Markdown
Contributor Author

Hi @ok-nick, any problems left?

@ho-229

ho-229 commented Jun 15, 2024

Copy link
Copy Markdown
Contributor Author

This fix looks weird but it works well.

Cloud Filter will copy remote files(or directories) to local automatically. However, renamed will not be invoked after rename so we can not remove the src from the remote.

@ok-nick

ok-nick commented Jun 15, 2024

Copy link
Copy Markdown
Owner

Ah, so when the target isn't in scope and the source is, it will invoke SyncFilter::delete rather than SyncFilter::rename?

If that's the case, I wonder if it'd be better to replace the source_in_scope/target_in_scope fns with a single enum to make it more clear. Something like: RenameAction::MoveInsideFromOutside + RenameAction::MoveInsideFromInside.

@ho-229

ho-229 commented Jun 16, 2024

Copy link
Copy Markdown
Contributor Author

It will not inoke SyncFilter::delete in this case.

@ok-nick

ok-nick commented Jun 16, 2024

Copy link
Copy Markdown
Owner

How is the file removed from the remote then, if not invoked by SyncFilter::delete? I also don't understand how SyncFilter::renamed plays a role here?

Also, we should keep the existing functionality for moving a file from outside the sync filter to inside the sync filter rather than keeping it as CloudErrorKind::NotSupported here.

@ok-nick

ok-nick commented Jun 17, 2024

Copy link
Copy Markdown
Owner

I pushed a branch named update-deps to update all the dependencies, let me know if it works for you #14

@ho-229

ho-229 commented Jun 17, 2024

Copy link
Copy Markdown
Contributor Author

I think I can't fix this problem, thanks for your reviews

@ho-229 ho-229 closed this Jun 17, 2024
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.

2 participants