Compare commits

...

1 Commits

Author SHA1 Message Date
claude[bot] fcb33e019a fix: add X-Tigris-Consistent headers to rclone commands
Add --header-download and --header-upload with X-Tigris-Consistent: true
to all rclone commands (bisync, sync, check, ls) to ensure consistent
reads from Tigris origin region instead of stale edge cache.

This fixes stale read issues for non-US users where edge nodes return
outdated file content during bisync operations.

Fixes #557

Co-authored-by: Paul Hernandez <phernandez@users.noreply.github.com>
Signed-off-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
2026-02-11 17:58:39 +00:00
2 changed files with 34 additions and 1 deletions
@@ -212,6 +212,10 @@ def project_sync(
remote_path,
"--filter-from",
str(filter_path),
"--header-download",
"X-Tigris-Consistent: true",
"--header-upload",
"X-Tigris-Consistent: true",
]
if verbose:
@@ -287,6 +291,10 @@ def project_bisync(
str(filter_path),
"--workdir",
str(state_path),
"--header-download",
"X-Tigris-Consistent: true",
"--header-upload",
"X-Tigris-Consistent: true",
]
# Add --create-empty-src-dirs if rclone version supports it (v1.64+)
@@ -356,6 +364,10 @@ def project_check(
remote_path,
"--filter-from",
str(filter_path),
"--header-download",
"X-Tigris-Consistent: true",
"--header-upload",
"X-Tigris-Consistent: true",
]
if one_way:
@@ -393,6 +405,14 @@ def project_ls(
if path:
remote_path = f"{remote_path}/{path}"
cmd = ["rclone", "ls", remote_path]
cmd = [
"rclone",
"ls",
remote_path,
"--header-download",
"X-Tigris-Consistent: true",
"--header-upload",
"X-Tigris-Consistent: true",
]
result = run(cmd, capture_output=True, text=True, check=True)
return result.stdout.splitlines()
+13
View File
@@ -130,6 +130,9 @@ def test_project_sync_success(tmp_path):
assert "--filter-from" in cmd
assert str(filter_path) in cmd
assert "--dry-run" in cmd
assert "--header-download" in cmd
assert "X-Tigris-Consistent: true" in cmd
assert "--header-upload" in cmd
assert kwargs["text"] is True
@@ -214,6 +217,9 @@ def test_project_bisync_success(tmp_path):
assert "--compare=modtime" in cmd
assert "--workdir" in cmd
assert str(state_path) in cmd
assert "--header-download" in cmd
assert "X-Tigris-Consistent: true" in cmd
assert "--header-upload" in cmd
def test_project_bisync_requires_resync_first_time(tmp_path):
@@ -369,6 +375,9 @@ def test_project_check_success(tmp_path):
assert result is True
cmd, kwargs = runner.calls[0]
assert cmd[:2] == ["rclone", "check"]
assert "--header-download" in cmd
assert "X-Tigris-Consistent: true" in cmd
assert "--header-upload" in cmd
assert kwargs["capture_output"] is True
assert kwargs["text"] is True
@@ -407,6 +416,10 @@ def test_project_ls_success():
project = SyncProject(name="research", path="app/data/research")
files = project_ls(project, "my-bucket", run=runner, is_installed=lambda: True)
assert files == ["file1.md", "file2.md", "subdir/file3.md"]
cmd, _ = runner.calls[0]
assert "--header-download" in cmd
assert "X-Tigris-Consistent: true" in cmd
assert "--header-upload" in cmd
def test_project_ls_with_subpath():