Skip to content

Repository sync restores trashed files whose content has not changed - #1499

Merged
WaylandYang merged 2 commits into
deeplethe:devfrom
Maya-Kid:codex/restore-git-repository-documents
Nov 16, 2026
Merged

WaylandYang merged 2 commits into
deeplethe:devfrom
Maya-Kid:codex/restore-git-repository-documents

Conversation

@Maya-Kid

Copy link
Copy Markdown
Contributor

Why

Repository sync should restore a locally trashed document when its file still exists upstream, as specified in #268. GitHub and GitLab both skipped the file when its upstream blob matched the local copy, so a sync could succeed while leaving the document in the trash indefinitely.

What changes

Only live documents can take the unchanged-file fast path. A trashed document goes through the existing ingest path, which restores the document and repairs its search and derived state. The two HTTP-fixture regressions verify the same document UUID, identical stored bytes, the same version count, and no additional fetches for other unchanged documents in the recovery round.

How it was checked

With Rust 1.98.1 and PostgreSQL 16.15 on Linux, both connector regressions failed on dev (f33f9fc9) and passed on 00d060a8.

  • cargo fmt --all --check passed.
  • cargo clippy --workspace --all-targets -- -D warnings passed on Linux.
  • cargo test --workspace passed on Linux with PostgreSQL and Poppler required. 1,848 passed and 6 were ignored.

Before review

  • The commit is signed off (git commit -s).
  • Workspace formatting, Clippy, and tests pass.

Signed-off-by: Maya Kid <BinjunYann@gmail.com>

@WaylandYang WaylandYang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks — the unchanged-file shortcut no longer skips files trashed locally, for both connectors. Merging.

@WaylandYang
WaylandYang merged commit 842cc4c into deeplethe:dev Nov 16, 2026
6 checks passed
@Maya-Kid
Maya-Kid deleted the codex/restore-git-repository-documents branch November 29, 2026 05:59
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.

2 participants