fix(matters): repoint KB link/unlink to the project attach/detach endpoints - #124
Open
sergiomaldo wants to merge 1 commit into
Open
fix(matters): repoint KB link/unlink to the project attach/detach endpoints#124sergiomaldo wants to merge 1 commit into
sergiomaldo wants to merge 1 commit into
Conversation
…points
?/linkKb and ?/unlinkKb still called the legacy
PATCH /api/v1/knowledge-bases/{kb_id} with {project_id}, which the backend
silently no-ops — the UI reported success but the KB was never linked.
Use the Wave D.1 T3 project-side endpoints instead:
attach: POST /api/v1/projects/{project_id}/knowledge-bases {knowledge_base_id}
detach: DELETE /api/v1/projects/{project_id}/knowledge-bases/{kb_id}
Tests updated to assert the new endpoints, plus a regression guard that the
legacy PATCH is never issued.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Problem
Linking a knowledge base to a matter from the UI silently does nothing. The
?/linkKb/?/unlinkKbactions insrc/routes/(app)/matters/[id]/+page.server.tscall the legacy single-project shapePATCH /api/v1/knowledge-bases/{kb_id}with{project_id}, which the api no-ops; perbackend.d.ts, attach/detach moved toPOST/DELETE /api/v1/projects/{project_id}/knowledge-bases[/{kb_id}]. Net effect:project_knowledge_basesstays empty, no request errors anywhere, and users cannot persistently attach a KB to a matter at all (the read path works, which makes the silence more confusing).Fix
Repoint both actions to the project attach/detach endpoints (POST with
{knowledge_base_id}; DELETE treating 204/404 as success). Tests rewritten to assert the new endpoints plus a regression test that the legacy PATCH is never issued.Testing
npm run check / lint green; vitest suite passing. Verified live: linking now persists across reloads on our deployment.
Found operating a production self-hosted legal deployment (law firm running Donna v0.6.2 fully local).
🤖 Generated with Claude Code