Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@lra
Copy link
Owner

@lra lra commented Oct 21, 2025

This pull request improves the robustness of the link_uninstall method in mackup/application.py by ensuring it only processes Mackup files that are valid symbolic links pointing to the correct home file. It also adds comprehensive tests to verify the new behavior, including handling cases where the Mackup file is not a symlink or points to the wrong target.

Robustness and correctness improvements

  • Updated the link_uninstall method to skip and warn when a Mackup file is not a symbolic link or does not point to the expected home file, preventing unintended file operations.

Test coverage enhancements

  • Added test_link_uninstall_mackup_not_a_link to verify that non-symlink Mackup files are skipped and a warning is printed.
  • Added test_link_uninstall_mackup_points_to_wrong_target to check that symlinks pointing to the wrong target are also skipped with a warning.
  • Added test_link_uninstall_mackup_points_correctly to confirm that normal operation proceeds when the symlink points to the correct home file.

Fixes #2111

@lra lra requested a review from Copilot October 21, 2025 12:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses a critical bug where link_uninstall would delete non-symlinked files from the user's home directory. The fix adds validation to ensure only proper Mackup symbolic links are processed during uninstall.

  • Added safety check to verify Mackup files are valid symlinks pointing to the correct home file
  • Added three comprehensive test cases covering non-symlink files, wrong-target symlinks, and correct symlinks
  • Warning message now displayed when skipping invalid symlink configurations

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
mackup/application.py Added validation to check if Mackup file is a symlink pointing to the expected home file before proceeding with uninstall
tests/test_application.py Added three test cases to verify the new safety behavior for different symlink scenarios

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@lra lra merged commit a330632 into master Oct 21, 2025
36 checks passed
@lra lra deleted the fix_2111 branch October 21, 2025 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

link uninstall deletes non-symlinked local files if the Dropbox file exists

1 participant