Skip to content

Decompression: When merging folders, files are overwritten silently #1004

Description

@marcospb19

Problem

When decompressing archives into the same destination (and merging folders), files with identical names can be silently overwritten.

This happens in the following scenarios:

  1. Decompress, and on conflict, user chooses the "merge" option.
  2. Decompress with --dir .
  3. Decompress with --here (equivalent to --dir)

Currently, conflict detection only operates at the folder level. Once a folder has been "accepted", each archive backend writes to files independently, possibly overwriting silently.

Expected behavior

  • Check and prompt for conflicts for every single file.
  • Ensure consistent behavior across all supported archive formats.

Context

This has been a known limitation that requires a refactor. Solving it would also require moving format-specific safety/sanity checks into the shared layer, since the formats would no longer be writing files directly. And allowing for "renaming" of nested folders that will have files inside of them requires some complex routing logic. Also ensure that logs for subsequent files that had their parents renamed have their paths fixed for their new location (requires a path trie for sure).

Originally posted by @roland-5 in #998 (comment)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions