Skip to content

Fix document deletion persistence issue (#278)#289

Merged
Wirasm merged 2 commits into
mainfrom
fix/document-deletion-persistence
Aug 18, 2025
Merged

Fix document deletion persistence issue (#278)#289
Wirasm merged 2 commits into
mainfrom
fix/document-deletion-persistence

Conversation

@Wirasm

@Wirasm Wirasm commented Aug 18, 2025

Copy link
Copy Markdown
Collaborator

Pull Request

Summary

Fixes issue #278 where document deletions were not persisting to the backend database. The UI would show documents as deleted, but they would reappear after page refresh.

Changes Made

  • Fixed API endpoints in projectService to include required project_id parameter
  • Added Document interface for improved type safety
  • Enhanced error messages to include projectId context for better debugging
  • Added comprehensive unit tests for all document CRUD operations
  • Added integration tests for DocsTab deletion flow
  • Updated vitest config to include new test files

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring

Affected Services

  • Frontend (React UI)
  • Server (FastAPI backend)
  • MCP Server (Model Context Protocol)
  • Agents (PydanticAI service)
  • Database (migrations/schema)
  • Docker/Infrastructure
  • Documentation site

Testing

  • All existing tests pass
  • Added new tests for new functionality
  • Manually tested affected user flows
  • Docker builds succeed for all services

Test Evidence

cd archon-ui-main && npx vitest run test/services/projectService.test.ts test/components/project-tasks/DocsTab.integration.test.tsx

Test Files  2 passed (2)
     Tests  27 passed (27)

Checklist

  • My code follows the service architecture patterns
  • If using an AI coding assistant, I used the CLAUDE.md rules
  • I have added tests that prove my fix/feature works
  • All new and existing tests pass locally
  • My changes generate no new warnings
  • I have updated relevant documentation
  • I have verified no regressions in existing features

Breaking Changes

None - this is a bug fix that maintains backward compatibility.

Additional Notes

Root cause was that the document deletion API calls were missing the project_id parameter in the URL path, causing 404 errors that were silently caught. The frontend state would update optimistically but the backend never received the delete request.

This fix ensures that:

  1. Document deletions properly reach the backend API
  2. The deletion persists across page refreshes
  3. All document operations have proper error handling with context
  4. Comprehensive test coverage prevents regression

Wirasm added 2 commits August 18, 2025 13:04
- Fixed projectService methods to include project_id parameter in API calls
- Updated deleteDocument() to use correct endpoint: /api/projects/{projectId}/docs/{docId}
- Updated getDocument() and updateDocument() to use correct endpoints with project_id
- Modified DocsTab component to call backend API when deleting documents
- Documents now properly persist deletion after page refresh

The issue was that document deletion was only happening in UI state and never
reached the backend. The service methods were using incorrect API endpoints
that didn't include the required project_id parameter.
- Add Document interface for type safety
- Fix error messages to include projectId context
- Add unit tests for all projectService document methods
- Add integration tests for DocsTab deletion flow
- Update vitest config to include new test files
@Wirasm

Wirasm commented Aug 18, 2025

Copy link
Copy Markdown
Collaborator Author

solves: #278

@coleam00

Copy link
Copy Markdown
Owner

Thanks @Wirasm !!

@Wirasm Wirasm merged commit a29b541 into main Aug 18, 2025
7 checks passed
@Wirasm Wirasm deleted the fix/document-deletion-persistence branch August 18, 2025 18:20
POWERFULMOVES added a commit to POWERFULMOVES/PMOVES-Archon that referenced this pull request Feb 12, 2026
)

Work Orders E2E integration tests - Phase 6 TAC sprint
coleam00 pushed a commit that referenced this pull request Apr 7, 2026
Command loading was failing for commands in .archon/commands/defaults/
because getCommandFolderSearchPaths() only searched .archon/commands/
directly. This was inconsistent with the workflow loader which searches
subdirectories recursively.

The fix adds .archon/commands/defaults to the search paths, maintaining
priority order: user commands first, then bundled defaults.

Fixes #282
Tyone88 pushed a commit to Tyone88/Archon that referenced this pull request Apr 16, 2026
Command loading was failing for commands in .archon/commands/defaults/
because getCommandFolderSearchPaths() only searched .archon/commands/
directly. This was inconsistent with the workflow loader which searches
subdirectories recursively.

The fix adds .archon/commands/defaults to the search paths, maintaining
priority order: user commands first, then bundled defaults.

Fixes coleam00#282
joaobmonteiro pushed a commit to joaobmonteiro/Archon that referenced this pull request Apr 26, 2026
Command loading was failing for commands in .archon/commands/defaults/
because getCommandFolderSearchPaths() only searched .archon/commands/
directly. This was inconsistent with the workflow loader which searches
subdirectories recursively.

The fix adds .archon/commands/defaults to the search paths, maintaining
priority order: user commands first, then bundled defaults.

Fixes coleam00#282
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