iamhyc / Overleaf-Workshop

Open Overleaf/ShareLaTex projects in vscode, with full collaboration support.
https://marketplace.visualstudio.com/items?itemName=iamhyc.overleaf-workshop
GNU Affero General Public License v3.0
448 stars 10 forks source link

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

Open pwintz opened 4 weeks ago

pwintz commented 4 weeks ago

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

[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
iamhyc commented 4 weeks ago

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 commented 4 weeks ago

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 commented 4 weeks ago

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 commented 3 weeks ago

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.