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

Local Changes are being Overridden By Remote Versions of Files #180

Open
pwintz opened this issue Aug 17, 2024 · 11 comments
Open

Local Changes are being Overridden By Remote Versions of Files #180

pwintz opened this issue Aug 17, 2024 · 11 comments
Assignees
Labels
bug Something isn't working

Comments

@pwintz
Copy link

pwintz commented Aug 17, 2024

Describe the bug

I am using Overlead-Workshop by opening a project locally. When I make changes to the local file and save, this alert pops up in the bottom-right corner and all the changes I made disappear: image

How To Reproduce

I'm not sure how my system got into this state. If I figure out reproduction steps, I'll post an update.

Environment

  • Overleaf Workshop Extension version: v0.13.2
  • VS Code version: Version: 1.92.2
  • Overleaf Edition: Official (Professional Subscription)

[Optional] Developer Logs

Here are the logs when I modify the file /biblio.bib:

[Extension Host] 8/17/2024, 4:18:53 PM [push] update "/biblio.bib"
console.ts:137 [Extension Host] 8/17/2024, 4:18:56 PM [push] update "/biblio.bib"
console.ts:137 [Extension Host] 8/17/2024, 4:19:00 PM [push] update "/biblio.bib"
console.ts:137 [Extension Host] Disconnected
console.ts:137 [Extension Host] SocketIOAPI: connected
@pwintz pwintz added the bug Something isn't working label Aug 17, 2024
@iamhyc
Copy link
Owner

iamhyc commented Aug 18, 2024

This is a force overwritten process starts every time when the extension connects to the overleaf server.

From the developer logs, it can see that you suffered from an unstable connection (the push action failed), and it reconnected itself.

@pwintz
Copy link
Author

pwintz commented Aug 18, 2024

Deleting my edits without confirmation is scary behavior! Would it be possible to modify the extension so that it either asks the user to confirm, backs up the local changes, or opens a "merge" window to allow users to reconcile the differences?

@iamhyc
Copy link
Owner

iamhyc commented Aug 18, 2024

Deleting my edits without confirmation is scary behavior! Would it be possible to modify the extension so that it either asks the user to confirm, backs up the local changes, or opens a "merge" window to allow users to reconcile the differences?

Cause it is not designed to "delete" but to "force sync", following the server version.

The current design is flaw, but an additional confirmation would also be annoying. Currently, I suggest you use a local version control system (like git) to save your temporary edits.

I will keep this issue open and see if there are better ideas.

@pwintz
Copy link
Author

pwintz commented Aug 20, 2024

Cause it is not designed to "delete" but to "force sync", following the server version.

That makes sense that it wasn't designed to delete a user's edits, but the practical effects are the same. I've lost now lost a significant number of edits twice.

Currently, I suggest you use a local version control system (like git) to save your temporary edits.

Both times I lost data, I didn't even have a chance to use git to save my edits. My changes just disappeared in a puff of smoke the next time my laptop connected to the internet.

@tophee
Copy link

tophee commented Nov 8, 2024

Hm, I'm trying to understand what this issue means. It sounds like the extension is basically broken (since it's purpose is to make it possible to edit Overleaf files with VS Code but those edits are at risk of being destroyed), but if that were the case, I suppose this issue would be more active than it is. So, what am I misunderstanding?

If the risk for data loss is not universal, what exactly are the conditions under which it occurs? Differently put: how can I avoid data loss when using the extension?

@qianchd
Copy link

qianchd commented Nov 20, 2024

Hm, I'm trying to understand what this issue means. It sounds like the extension is basically broken (since it's purpose is to make it possible to edit Overleaf files with VS Code but those edits are at risk of being destroyed), but if that were the case, I suppose this issue would be more active than it is. So, what am I misunderstanding?

If the risk for data loss is not universal, what exactly are the conditions under which it occurs? Differently put: how can I avoid data loss when using the extension?

I think the issue will happen when you use the locally-edit mode. Actually, it happens when your network is unstable and two or more guys are editing the same project at the same time. Since the history logging of overleaf is kind of lean comparing to things like git, it seems impossible to check whether the local part or the remote part is crushed. ? So the handy solution will be preserve a local version control (which the developers are trying to do).

The short suggestion could be: using the standard default mode (it is exactly the same as you edit on the web page) rather than the locally-editing mode when you cooperate with others. The local mode can be reliable for your single-person project.

@pwintz
Copy link
Author

pwintz commented Nov 20, 2024 via email

@qianchd
Copy link

qianchd commented Nov 20, 2024

When I was using it, my changes were squashed the next time I connected to the Internet, even though nobody else was changing the remote document.

Yes, it happens when you have edited without network or without connect to the Overleaf-workshop plug-in and then re-connected, alll the things will pull from the remote.

@tophee
Copy link

tophee commented Nov 21, 2024

rather than the locally-editing mode when you cooperate with others.

My take-away is: don’t use the plugin at all when cooperating with others. The risk seems too high. (See #180 (comment)) Or is there a way of making sure that you never edit locally? (I don’t know how exactly the plugin works, since I’ve been too afraid of using it.)

when you have edited without network or without connect to the Overleaf-workshop plug-in and then re-connected

This seems to be the key point. But what exactly does it mean? How long can the network connection be interrupted before the shit starts hitting the fan? What do you mean by ”connect to the Overleaf-workshop plug-in”? Do you mean turning the plugin on? Or that the plugin should have an active connection with the overleaf server?

@qianchd
Copy link

qianchd commented Nov 21, 2024

rather than the locally-editing mode when you cooperate with others.

My take-away is: don’t use the plugin at all when cooperating with others. The risk seems too high. (See #180 (comment)) Or is there a way of making sure that you never edit locally? (I don’t know how exactly the plugin works, since I’ve been too afraid of using it.)

when you have edited without network or without connect to the Overleaf-workshop plug-in and then re-connected

This seems to be the key point. But what exactly does it mean? How long can the network connection be interrupted before the shit starts hitting the fan? What do you mean by ”connect to the Overleaf-workshop plug-in”? Do you mean turning the plugin on? Or that the plugin should have an active connection with the overleaf server?

When one uses the feature "opening project locally", there will be a local copy of the project. Then when one wants to modify some lines locally, he/she may directly right-clicks the folder and then open the local folder in vscode. Such behavior will make the changes being overwritten next time you connect to the plug-in. To keep everything on track, one must open the project folder via the command "open project locally" in the plug-in and make sure the internet is connected.

Without the local-edit feature, you can edit your project by the default mode, when your internet is unstable, your changes will be failed to save (and there will be notifications from the vscode). So the editing experience will be the same as working on the web page.

@pwintz
Copy link
Author

pwintz commented Jan 10, 2025

Is there any chance of getting this fixed? As it is now, editing an Overleaf project locally is unusable.

@pwintz pwintz closed this as completed Jan 10, 2025
@pwintz pwintz reopened this Jan 10, 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

When branches are created from issues, their pull requests are automatically linked.

4 participants