Skip to content

fix(chunk): fix unexisting get_document_chunk call#782

Merged
leoguillaume merged 1 commit into
mainfrom
781-document-get-v1documentsidchunkschunk_id-returns-500-due-to-wrong-method-name
Mar 17, 2026
Merged

fix(chunk): fix unexisting get_document_chunk call#782
leoguillaume merged 1 commit into
mainfrom
781-document-get-v1documentsidchunkschunk_id-returns-500-due-to-wrong-method-name

Conversation

@tibo-pdn

@tibo-pdn tibo-pdn commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes a 500 error on GET /v1/documents/{document_id}/chunks/{chunk_id} caused by a call to a non-existent method get_document_chunk on the document manager. The correct method is get_document_chunks (plural).
The argument order was also adjusted to match the method's signature.

Resolves #781.

Overview

This section provides a checklist to help categorize and describe the changes made in this PR.

Area

Please select the area(s) that this PR affects:

  • Core / Global project settings
  • API
  • Playground / Web UI
  • DevOps
  • Docusaurus / Documentation
  • Other (specify below)

Type of change

Please select the type of change that this PR introduces:

  • New feature
  • Bugfix
  • Enhancement (improvement of an existing feature)
  • Refactor (change that neither fixes a bug nor modifies behavior)
  • Documentation
  • Tests
  • Performance improvement
  • Chore / Maintenance (change to the build process or auxiliary tools, dependencies update, etc.)

Definition of Done / Technical changes

Please provide the Definition of Done (DoD) criteria that apply to this PR.

  • get_document_chunk renamed to get_document_chunks in api/endpoints/documents.py:250
  • user_id argument repositioned to match the correct method signature

Screenshots / Demo (if applicable)

For more screenshots, please refer to #781.

Breaking changes

Please select one of the following options:

  • No breaking changes
  • This PR contains breaking changes (explain below)

Quality assurance & Review readiness

Before requesting a review, please take a moment to confirm that the following aspects have been considered and addressed.

This section helps ensure the PR is ready for review, safe to merge, and deployable. If any items are left unchecked, please add a brief explanation for context.

Documentation

Please select one of the following options:

  • No documentation needed
  • README / Markdown files updated
  • API documentation updated (Swagger / Redoc)
  • Docstrings updated
  • Inline code comments added where needed

Tests

Please select one or more of the following options:

  • No tests added (explain below)
  • Unit tests added
  • Integration tests added
  • Functional tests added
  • End-to-end tests added
  • Performance tests added
  • Existing tests updated

The fix is a one-line method name correction - no new logic introduced. Existing integration tests covering this endpoint should be sufficient. Also, tests are completely nder clean architecture migration. This branch is just a quick fix.

Code Standards

  • Code follows project conventions and architecture
  • No unused imports, variables, functions, or classes
  • No debug logs or commented-out code left
  • No secrets or environment variables committed in clear text
  • Code is linted and formatted using the project tools (ruff, etc.)

Git & Process Standards

  • PR title follows Conventional Commits
  • PR is correctly labeled
  • PR is linked to relevant issue(s) / project(s)
  • Author is assigned to the PR
  • At least one reviewer has been requested

Deployment Notes

  • No special deployment steps required
  • Requires database migration (see "Database migration" section)
  • Requires new or updated environment variables (explain below)
  • Requires other special deployment steps (explain below)

Database migration

Please select one of the following options:

  • No database migration required
  • This PR requires a database migration (see checklist below)

Please confirm that the following steps have been completed for the database migration:

  • Migration script added to api/alembic/versions/ folder
  • Migration upgrade tested locally
  • Migration downgrade tested locally
  • Migration documented (if applicable)

Reviewer Focus

Single-line fix in api/endpoints/documents.py:250 — verify the correct method name and that the argument order matches get_document_chunks's signature.

@tibo-pdn tibo-pdn requested a review from leoguillaume March 17, 2026 08:58
@tibo-pdn tibo-pdn self-assigned this Mar 17, 2026
@tibo-pdn tibo-pdn added the bug label Mar 17, 2026
@tibo-pdn tibo-pdn added this to the Release 1.0.0 milestone Mar 17, 2026
@leoguillaume leoguillaume merged commit 133ebac into main Mar 17, 2026
5 of 6 checks passed
@leoguillaume leoguillaume deleted the 781-document-get-v1documentsidchunkschunk_id-returns-500-due-to-wrong-method-name branch March 17, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[document] GET /v1/documents/{id}/chunks/{chunk_id} returns 500 due to wrong method name

2 participants