meganz / MEGAsync

Easy automated syncing between your computers and your MEGA Cloud Drive
Other
1.63k stars 280 forks source link

[Issue] Messing up files #416

Open rosenbergd opened 4 years ago

rosenbergd commented 4 years ago

Megasync decides once in a while to just download files I've deleted, this time it downloaded files into my Android Studio folder causing me to waste hours trying to figure out why Android Studio refused to open, I've requested this feature before, but this is no longer a feature, it's a bug.

There should seriously be a way of indicating to Megasync to only use the computer as the source and not update the computer with the content but rather assume the computer is the one that's up to date unless directly added to Mega.

I'm not sure why it's not capable of keeping track of which files I had on the computer before so it can verify they've been deleted rather than deciding they're missing and redownloading them, but it's making a massive mess of my files

polmr commented 4 years ago

Hi @rosenbergd MEGAsync currently provides two way synchronization only. However, as you mention, a local deletion should cause a remote deletion, not a re-download. If you are kind enough, please, use MEGAsync feature to report an issue (Settings->Account->Report Issue), fill in the issue description with as much detail as you can give (plus a reference to this issue in github) and include diagnostic log files. Precise information like the names & paths of the files that have been problematic, sync configurations, ... will be of great assistance. Thanks for reporting that and apologies for any inconvenience you may have experienced

mattw-mega commented 4 years ago

Hi @rosenbergd, that's good advice from polmr, that will help a lot. Also, do you ever turn your syncs off and on again in the Settings dialog? thanks

rosenbergd commented 4 years ago

Hi @mattw-mega, no, I always keep the syncs on, sometimes Megasync does crash though. This issue usually correlates with a crash (it crashes at some point or gets stuck and then changes are made and at some point megasync is restarted either by a restart or due to a crash at which point it proceeds to download files that were deleted locally)

mattw-mega commented 4 years ago

thanks very much for the extra info, that helps a lot. We will look out for your bug report - if you can estimate the date/time that it happened (and please do attach logs and let us know the time zone too as logs are in UTC) that will also help. If your mega account email is different from your email here, please let us know some text from the report that you submit, when you do that. thanks!

rosenbergd commented 4 years ago

Last one happened yesterday, I couldn't find any logs referring to the files changed, I'll try seeing if this happens again and send a log, but until then, that's the best I have (also the crashDumps folder is empty, I'm not sure if that's supposed to be the case)

mattw-mega commented 4 years ago

Hi rosenbergd , thanks for your recent uploaded issue report with logs. The log showed the application was restarted a few minutes before the report was sent, however no files were downloaded after the restart. It does take a long time to look into these very large logs, so please do make sure you have reproduced the issue before sending those reports. Also please let us know the name of the file erroneously downloaded to make it easier to search the logs and figure out what is going on. thanks

dsimat commented 4 years ago

Yeah, same here. When I delete files, sometimes MEGA re-downloads the deleted files. I just submitted an error report.

mattw-mega commented 4 years ago

hi @dsimat , do you ever stop and start the sync (eg. by unticking and re-ticking the checkboxes in settings, or maybe it's an external drive that you remove from time to time)? If the sync is started again after something was deleted, it will take the safe option of uploading/downloading since when starting fresh, it doesn't know if the mismatch is due to a file added or a file deleted. Also, in your report did you specify which file you thought was erroneously downloaded, and when? thanks

dsimat commented 4 years ago

Hello. This happens sometimes when I run out of space but it didn't happen now. This is a very recent problem - I noticed it in the beginning of April or so.

In the report I did not specify the files that shouldn't have been downloaded because all of the downloaded files were wrongly downloaded.

My report has the following Ticket ID: ILP-348-21198

rosenbergd commented 4 years ago

This could be fixed in a very easy way by changing the syncing algorithm to one similar to git (even a very simplified version of git).

Simple version of the above (to avoid complexity of a git-like system): keep a DB with paths and hashes of files (and deletion, modification and creation events done on those files with event hash for matching purposes) on both the server and client, that ways when mega opens again, it can check whether or not such a file was created on the server or deleted locally (if need be, it can ask for user interference). There's a versioning system and trash can as is so if a file needs to be recovered or an old version is needed, it can be done (if a file is deleted when mega is open it deletes it from the server anyways).

Possible special case: modification events on both DBs that do not correlate (this is where the user should be notified or special settings can be applied on the user's side such as: "keep local", "use server" and "ask").

Cases:

I'm certain I may have missed a few cases, this would need to be checked for all possible cases and it may also not be refined, it's just an idea off the top of my head.

This is of course just me going on a rant, you can implement this when time permits or completely discard it, it's just a suggestion and I'm not certain how it currently operates but I'm certain this way would avoid such strange behaviour.

RiseT commented 4 years ago

Could this issue be related to my (very) long-time problem https://github.com/meganz/MEGAsync/issues/22 ?