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

Syncing Renamed Files #183

Open
sleepymalc opened this issue Aug 22, 2024 · 9 comments
Open

Syncing Renamed Files #183

sleepymalc opened this issue Aug 22, 2024 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@sleepymalc
Copy link

Describe the bug

A clear and concise description of what the bug is.

When renaming a file on Overleaf and reopening the local repo, the syncing will only create new files with the new name, but will not remove the local files with the old names.

Expected behavior

A clear and concise description of what you expected to happen.

Renaming should be executed appropriately on the local side as well when syncing.

How To Reproduce

Detailed steps to reproduce the behavior.

As described.

Environment

  • Overleaf Workshop Extension version: 0.13.2
  • VS Code version: 1.92.2
  • Overleaf Edition: Official
@sleepymalc sleepymalc added the bug Something isn't working label Aug 22, 2024
@iamhyc
Copy link
Owner

iamhyc commented Aug 22, 2024

When renaming a file on Overleaf and reopening the local repo, the syncing will only create new files with the new name

The sync will not remove the local existing files.

Rename is just to delete an old file and create a new file, so the old file still exists after the sync.

@sleepymalc
Copy link
Author

If a file is removed from the server, I think it should also be removed from the local?

@iamhyc iamhyc added question Further information is requested and removed bug Something isn't working labels Aug 22, 2024
@iamhyc
Copy link
Owner

iamhyc commented Aug 22, 2024

If a file is removed from the server, I think it should also be removed from the local?

"remove" is an "action", "sync" only sync the "status".

@sleepymalc
Copy link
Author

it's not really meaningful to argue what does "sync" mean literally here. The expected behavior is something more important I think. In any case, I'll expect that when I change the name of the file, the same thing should be done in my local repo, not leaving files with old name waiting to be removed manually.

@iamhyc
Copy link
Owner

iamhyc commented Aug 22, 2024

it's not really meaningful to argue what does "sync" mean literally here. The expected behavior is something more important I think. In any case, I'll expect that when I change the name of the file, the same thing should be done in my local repo, not leaving files with old name waiting to be removed manually.

think twice. I am not argue with you about "rename files" but why the "delete" is ignored.

@sleepymalc
Copy link
Author

This is more like an unexpected behavior. If we're regarding delete as an action, then actually creat is also an action.
So if sync indeed creates a new file in the local repo, it's expected that the old file will also be deleted by sync.

@iamhyc
Copy link
Owner

iamhyc commented Aug 22, 2024

This is more like an unexpected behavior. If we're regarding delete as an action, then actually creat is also an action. So if sync indeed creates a new file in the local repo, it's expected that the old file will also be deleted by sync.

Exactly. But the fact is that, "sync will not remove the local existing files". It currently only creates/overwrites files, because "delete" may cause more severe unexpected behavior.

The root cause is that, local folder does not have version control! Every time you open the folder in vscode, it has to keep up with the "status", the status of the web server.
As you said, non-existing files on server should be also deleted locally. But what if I have temporary files before? Or some files create locally not synced to the server? I cannot simply delete them.

I agree that the behavior should be fixed. The problem here is how to sync (or merge) the status between the local and the server.

@sleepymalc
Copy link
Author

sleepymalc commented Aug 22, 2024

I think the expected behavior is that, if there's a tmp file the user wants to ignore and not sync to the server, then it should be added via the ignoring list (or pattern). Everything not matched by the ignoring list should be sync exactly. At least this is the expected behavior for me. Not sure whether this will cause other issues that I'm not aware of tho.

@iamhyc
Copy link
Owner

iamhyc commented Aug 22, 2024

I think the expected behavior is that, if there's a tmp file the user wants to ignore and not sync to the server, then it should be added via the ignoring list (or pattern). Everything not matched by the ignoring list should be sync exactly. At least this is the expected behavior for me. Not sure whether this will cause other issues that I'm not aware of tho.

That is tricky. I would prefer merge the changes, but of course, it will create two files in the "rename file" case.

I may finally need to add a version control for the local folder. Before that, I don't want to delete any files. If the current behavior bothers you, you can try to delete the whole local folder, except for the ".overleaf" folder, every time before opening it in vscode.

I will post any progress on the version control thing in another issue #180 .

@iamhyc iamhyc self-assigned this Oct 3, 2024
@iamhyc iamhyc added bug Something isn't working and removed question Further information is requested labels Jan 17, 2025
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

No branches or pull requests

2 participants