Skip to content

Implement file conflict resolution and out of disk space check#2

Merged
guydols merged 2 commits into
mainfrom
dev
Apr 15, 2026
Merged

Implement file conflict resolution and out of disk space check#2
guydols merged 2 commits into
mainfrom
dev

Conversation

@guydols

@guydols guydols commented Apr 15, 2026

Copy link
Copy Markdown
Owner

This pull request introduces robust, preemptive disk-space checks to the filesync protocol, ensuring that both client and server verify sufficient disk space before starting a sync. If insufficient space is detected, the sync is aborted early and the other side is notified, preventing partial transfers and unclear errors. Additionally, the handling and reporting of conflict copies during sync are improved.

Disk-space checking and error handling:

  • Added preemptive disk-space checks on both the client and server before file transfer begins, using new helpers check_disk_space and available_disk_space in common.rs. If not enough space is available, a new InsufficientDiskSpace protocol message is sent and the sync is aborted. [1] [2] [3] [4] [5] [6] [7] [8]

  • Both client and server now handle incoming InsufficientDiskSpace messages gracefully, surfacing clear errors to the user/operator and aborting the session cleanly. [1] [2] [3] [4]

Conflict copy reporting improvements:

  • Enhanced reporting and publication of conflict copies when applying bundles or committing large files, including logging and publishing structured events to the message bus. The BundleApplied struct now tracks conflict copies, and all relevant functions log and broadcast these events. [1] [2] [3] [4] [5] [6] [7]

Refactoring and API changes:

  • The return value of engine.apply_bundle is now unpacked to obtain the count of written files, aligning with new conflict tracking. [1] [2]

Dependency update:

  • Added the fs2 crate as a dependency for cross-platform disk space queries.

@guydols guydols self-assigned this Apr 15, 2026
@guydols guydols merged commit 8518011 into main Apr 15, 2026
1 check passed
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.

1 participant