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

Rollback for snapshot merge #3017

Closed
typpos opened this issue Jun 6, 2023 · 3 comments
Closed

Rollback for snapshot merge #3017

typpos opened this issue Jun 6, 2023 · 3 comments
Labels
added in next build Added in the next Sandboxie version Feature request New feature or idea Snapshot Issues with the snapshot feature of Plus UI

Comments

@typpos
Copy link
Contributor

typpos commented Jun 6, 2023

Is your feature request related to a problem or use case?

Feature:

  • Snapshot system to be able to roll back when a merge fails

Motivation:

  • Even though the snapshot manager seems to try to l,ock the base folders, a merge can still fail because of unboxed applications, junctions, and other reasons. In such cases, the user ends up with an inconsistent UI state, inconsistent snapshot data, and is required to manually resolve the merge.
  • I've had issues twice so far when working (not 'testing') with snapshots where a merge fails. Once I lost files (dunno how), and another time I had to manually complete the merge by carefully copying files across directories, leaving me unsure if registry and other data are consistent.

Example Repro:

  • Create a sandox
  • Create some folders in it
  • Create a snapshot
  • Browse the sandboxed folders with an unsandboxed File Explorer
  • Change directory away/out of the sandboxed folders
  • Delete the snapshot
  • Not always, but reasonably often the delete fails

Suggestion:

NTFS has / used to have transactional file operations (TxF), but they are being deprecated so probably not an option.

A workable alternative might be to create a log file with reversible actions (essentially just move actions), and to move to-be-deleted/replaced files to a temp folder before actually deleting that entire temp folder at the very end. The log can be re-processed by sandboxie even in case of a crash or for a retry.

Describe the solution you'd like

Ability to roll back.

Being sure my sandboxes remain consistent without data loss when using snapshots.

Describe alternatives you've considered

Manually copy a snapshot / current outside the sandbox before merging.

@typpos typpos added the Feature request New feature or idea label Jun 6, 2023
@isaak654 isaak654 added the Snapshot Issues with the snapshot feature of Plus UI label Jun 6, 2023
@DavidXanatos DavidXanatos added the ToDo To be done label Jun 8, 2023
@DavidXanatos
Copy link
Member

This is a good idea we should make the snapshot Featue more robust.

@typpos
Copy link
Contributor Author

typpos commented Jun 8, 2023

If you revisit the core merge algorithm, maybe consider:

  • Option to copy or move files, ie apply vs merge.
  • Option to treat source as parent (target wins merge conflict) or child (source wins)

This would enable a range of interesting use cases where a snapshot can be treated as a "storage package" that can be used across multiple boxes (move-to, copy, drop, merge-into-X-as-parent, apply-to-X-as-child, etc).

@DavidXanatos DavidXanatos added added in next build Added in the next Sandboxie version and removed ToDo To be done labels Jul 24, 2023
@DavidXanatos
Copy link
Member

In the next build the snapshot should not be left in an unusable state, the plan is to throw an error and then let the user try to delete it again and again and again until it works.
So the code now should gracefully handle partially merged snapshots and be able to continue when encountering a snapshot that was already attempted to be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
added in next build Added in the next Sandboxie version Feature request New feature or idea Snapshot Issues with the snapshot feature of Plus UI
Projects
None yet
Development

No branches or pull requests

3 participants