Commit Graph

3 Commits

Author SHA1 Message Date
dc06d296a3 test(backend): test catalog HTTP error cases
Add tests for:
- moveItemsToDirectory (success, same-parent precondition, conflicts)
- createDirectory errors (parent not found, not a directory, duplicate)
- bulk delete type validation (files vs directories)- listDirectory
pagination (limit, cursor, invalid inputs)

Also fix test setup to use httperr.ErrorHandler so HTTPErrorstatus codes
are properly returned.

Co-authored-by: Ona <no-reply@ona.com>
2026-01-05 00:45:38 +00:00
d0c2a21ffd fix: add ResolveRenameOp to handle directory renames
RenameNode was calling Resolve() which generated blob keys for
directories that don't have blobs, causing 'key not found' errors.

Added ResolveRenameOp to BlobKeyResolver interface:
- FlatKeyResolver returns nil (UUIDs don't change on rename)
- HierarchicalKeyResolver returns move op for files and directories

This allows directory renames to work correctly with flat storage,
and leverages os.Rename for atomic directory moves with hierarchical.

Co-authored-by: Ona <no-reply@ona.com>
2026-01-04 23:58:43 +00:00
b8e1671248 test: add HTTP integration tests for catalog endpoints
Tests cover directory and file operations:
- List, fetch, create directories
- Fetch, download, rename files
- Trash and permanent delete (single and bulk)
- 404 for non-existent resources
- Verification that permanent deletes return 404

Directory rename test skipped due to VFS bug with blob
key resolution for directories.

Co-authored-by: Ona <no-reply@ona.com>
2026-01-04 23:54:30 +00:00