fix: Handle Windows line endings in rclone bisync by phernandez · Pull Request #422 · basicmachines-co/basic-memory · GitHub
Skip to content

fix: Handle Windows line endings in rclone bisync - #422

Merged
phernandez merged 1 commit into
mainfrom
fix/rclone-line-endings
Nov 11, 2025
Merged

fix: Handle Windows line endings in rclone bisync#422
phernandez merged 1 commit into
mainfrom
fix/rclone-line-endings

Conversation

@phernandez

Copy link
Copy Markdown
Member

Summary

Fixes rclone bisync failures on Windows caused by line ending conversions (LF→CRLF).

Problem

Customer reported bisync failing with "corrupted on transfer: sizes differ src 5163 vs dst 5632" error. The 469-byte difference exactly matches the number of line breaks in the file, indicating LF (1 byte) to CRLF (2 bytes) conversion on Windows.

Solution

Added --compare=modtime flag to rclone bisync command. This makes bisync compare only modification times instead of size+modtime, preventing line ending conversions from being treated as file corruption.

Changes

  • Modified src/basic_memory/cli/commands/cloud/rclone_commands.py:205
  • Added --compare=modtime flag to bisync command
  • Updated docstring to document this behavior

Testing

  • All existing tests pass
  • Fix specifically addresses Windows text file handling
  • Users will need to run --resync once after updating to establish new baseline

Customer Impact

Resolves the reported issue where editing files in the cloud web interface on Windows causes bisync to fail. The fix allows Windows to use CRLF endings without triggering false corruption warnings.

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

Fixes issue where rclone bisync treats LF→CRLF line ending conversions
as file corruption due to size differences. By comparing only modification
times instead of size+modtime, we allow Windows to use CRLF endings
without triggering false corruption warnings.

This resolves the customer-reported issue where editing files in the cloud
web interface on Windows causes bisync to fail with "sizes differ" errors.

The 469-byte difference reported was exactly the number of line breaks in
the file, confirming the LF (1 byte) to CRLF (2 bytes) conversion issue.

Related: Windows text file line ending handling
Signed-off-by: phernandez <paul@basicmachines.co>
@github-actions

github-actions Bot commented Nov 11, 2025

Copy link
Copy Markdown
Contributor

@phernandez
phernandez merged commit e9d0a94 into main Nov 11, 2025
16 checks passed
@phernandez
phernandez deleted the fix/rclone-line-endings branch November 11, 2025 15:08
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