Skip to content

fix: resolve document IDs by exact library path - #721

Open
DivyamTalwar wants to merge 1 commit into
VectifyAI:mainfrom
DivyamTalwar:fix/document-id-exact-path
Open

DivyamTalwar wants to merge 1 commit into
VectifyAI:mainfrom
DivyamTalwar:fix/document-id-exact-path

Conversation

@DivyamTalwar

Copy link
Copy Markdown

Refs #637.

Summary

get_document_id("Archive/Q3.pdf") previously discarded the folder. It could return a different document named Q3.pdf from another part of the library.

Use the named listing to find candidates, then require an exact path match for a cloud path. Paginate by the number of documents returned, allow a unique bare filename, and raise on ambiguity. Local mode keeps its existing basename lookup. A repeated result page without a total raises instead of blocking the caller.

Validation

  • The regression reproduces the wrong-document result on main with two same-name documents. The patched SDK picks the exact path across capped listing pages, refuses a missing path and reports ambiguous bare names.
  • A real loopback server received GET /docs/ with offsets 0 and 1 and the correct filename filter. The Local API basename test also passes.
  • 17 lookup and document-listing tests passed. git diff --check passes.

This branch has not been deployed

No deployments
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