docs(review): correct reconcile docstring + clarify scanner rename comment
Round-2 review follow-ups (PR #857), both documentation-only: - sharing_state.py: reconcile_document_path docstring no longer claims it returns False when no real points exist — it returns True and the set_payload is a Qdrant-side no-op (callers discard the return value). - scanner.py: reword the rename-reconcile comment to state the precise reason (modified_at stable so not re-queued; path may be stale from a rename) rather than the loose "dedup miss / etag changed" phrasing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
a03bc0af66
commit
b7479b0d07
@@ -590,15 +590,16 @@ async def scan_user_documents(
|
|||||||
elif existing_metadata is not None and not existing_metadata.get(
|
elif existing_metadata is not None and not existing_metadata.get(
|
||||||
"is_placeholder", False
|
"is_placeholder", False
|
||||||
):
|
):
|
||||||
# Unchanged content (not re-queued) but the file may have
|
# Reached only on the rename-with-stable-mtime path: a
|
||||||
# been renamed/moved: a rename keeps the fileid while
|
# fresh modified_at would have set needs_indexing, and an
|
||||||
# changing the path, and the dedup miss here means the
|
# etag dedup hit would have continued above -- so here the
|
||||||
# etag changed without a modified_at bump. Refresh the
|
# content wasn't re-queued (modified_at stable) yet the
|
||||||
# stale path/title metadata without re-embedding. No-op
|
# stored path may be stale from a rename/move (the fileid
|
||||||
# when the path is unchanged. Skip placeholders: reconcile
|
# is unchanged). Refresh path/title without re-embedding;
|
||||||
# only touches real chunks, so a not-yet-indexed file would
|
# reconcile_document_path no-ops when the path matches.
|
||||||
# just incur a 0-point set_payload (the real index writes
|
# Skip placeholders: reconcile only touches real chunks, so
|
||||||
# the current path anyway).
|
# a not-yet-indexed file would just incur a 0-point
|
||||||
|
# set_payload (the real index writes the current path).
|
||||||
try:
|
try:
|
||||||
await reconcile_document_path(
|
await reconcile_document_path(
|
||||||
file_id,
|
file_id,
|
||||||
|
|||||||
@@ -188,9 +188,11 @@ async def reconcile_document_path(
|
|||||||
rewrites ``file_path`` and the derived ``title`` on every real chunk via a
|
rewrites ``file_path`` and the derived ``title`` on every real chunk via a
|
||||||
single metadata-only ``set_payload`` (no re-fetch, no re-embed).
|
single metadata-only ``set_payload`` (no re-fetch, no re-embed).
|
||||||
|
|
||||||
No-op (returns False) when the path is unchanged or no real points exist yet
|
Returns False (no write attempted) only when the path is unchanged or empty.
|
||||||
(filter matches nothing). A legacy point with no stored ``file_path`` is
|
When the path differs it returns True after issuing the ``set_payload``; that
|
||||||
treated as changed, backfilling both fields.
|
write is itself a Qdrant-side no-op if no real chunks exist yet (e.g. only a
|
||||||
|
placeholder), which the callers tolerate. A legacy point with no stored
|
||||||
|
``file_path`` is treated as changed, backfilling both fields.
|
||||||
"""
|
"""
|
||||||
if not current_path or stored_path == current_path:
|
if not current_path or stored_path == current_path:
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user