s-h-a-d-o-w / s3-smart-sync

Server & client (Windows only!) for syncing S3 buckets via SNS
0 stars 0 forks source link

Clients that were offline might restore deleted files #1

Open s-h-a-d-o-w opened 6 days ago

s-h-a-d-o-w commented 6 days ago

This could be resolved the following way:

  1. When clients are first started, they generate a uuid for themselves that they send to the server on connection. When the server loses the connection to a client, it will store the uuid/timestamp pair.
  2. The server keeps a log of all operations happening on S3 and when a client connects again, the server "replays" all actions that happened since the client last connected.

Problems that have to be considered:

s-h-a-d-o-w commented 6 days ago

A simpler way of dealing with this that might be good enough for now might be to do something similar to what cryptomator does on android. Which is that it doesn't allow creating new files while there's no connection to S3.

This could be done by modifying the permissions of the S3 directory to block write access recursively. AND a message would have to be shown to the user to make them aware of this!

Unfortunately, this would require admin privileges because we can't necessarily assume that only the active user writes to that directory. Which would require additional app logic, particularly around the auto-start.

And so for now, for the sake of even more simplicity... I think it's best to just show a popup, tell people not to write to their S3 directory until they're connected again AND adjust initial syncing in a way that it will also delete local files that got deleted on S3 while they were offline. [Update] Actually... that would be a problem for the CLI version...