Repository navigation
Keep Google Drive document identity tied to the file ID - #1497
Merged
WaylandYang merged 2 commits intoNov 16, 2026
Merged
WaylandYang merged 2 commits into
WaylandYang merged 2 commits into
Conversation
Signed-off-by: Maya Kid <BinjunYann@gmail.com>
WaylandYang
approved these changes
Nov 16, 2026
WaylandYang
left a comment
Contributor
There was a problem hiding this comment.
Thanks, this is correct for Drive. Notion (notion://{id}, where a duplicated page has identical text) and the custom endpoint (custom:{id}) are also keyed by a stable ID and still go through Identity::Path, so they have the same rekey bug — a follow-up moving them to StableId would be welcome. Merging.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A copied Google Drive file gets a different file ID even when its bytes are unchanged. Syncing the copy currently treats it as a path rename: after
a.txtis synced, addingb.txtwith the same bytes changes the original document's external key togdrive://band leavesgdrive://aunbound.What changes
Key Drive sync only by its stable file ID. A different ID with the same content remains a duplicate under the existing per-base content rule, including when the original is temporarily outside the selected folders. If the copy later has different content it gets its own document. Path-based sources and the explicit API tombstone-and-rekey behavior keep their existing rules.
How it was checked
Validation on Linux x86_64, Rust 1.98.1, PostgreSQL 16 with the production schema:
f33f9fc9failed because the original UUID now had keygdrive://band filenameb.txt. The same test passed at812b7e50and checks the original UUID, key, name and version history, independent import of the edited copy, and a same-content duplicate after the original becomes missing.cargo fmt --all --check,git diff --check, and Linuxcargo clippy --workspace --all-targets -- -D warningspassed.Before review