refactor(api): remove 5 dead routes + stale deprecation markers
An audit (backend /api routes vs SvelteKit frontend usage, adversarially
verified across the whole repo) found these 5 routes have ZERO callers — no
frontend, no test, no protocol layer, no internal caller — and are superseded:
- GET /api/folders/paginated no-op duplicate of GET /api/folders
(discards the page arg); superseded by
the cursor-paginated /{id}/resources.
- POST /api/dedup/upload superseded by /api/files/upload, which
does the identical CDC dedup ingest.
- POST /api/people/{id}/hide the hide-person toggle was never built
into the UI (is_hidden never read).
- GET /api/admin/settings/general never called anywhere.
- GET /api/admin/settings/registration only the PUT is used; the GET had no
caller (PUT kept).
Removes each route, its handler + _impl, the now-orphaned DedupUploadResponse
DTO + its two serialization tests, the set_hidden service method (only caller
was hide_person), and the OpenAPI path/schema registrations.
Also cleans 4 stale markers: two #[allow(deprecated)] that no longer suppress
anything (zero #[deprecated] remain), the "Legacy folder endpoints (contents,
listing)" comment (both already removed), and a "Re-export AppError for backward
compatibility" comment describing a re-export that doesn't exist.
Net -323 lines. The 31 other unused-by-frontend routes (device-code auth,
CardDAV contact-groups, people/photos & music WIP, dedup/admin debug, i18n,
openapi.json) are intentional surface and were left untouched.
cargo clippy --all-features --all-targets -D warnings: clean. cargo test: 446 passed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -56,9 +56,7 @@ use crate::interfaces::api::handlers::contacts_handler::{
|
||||
AddMemberRequest, AddressBookResponse, CreateAddressBookRequest, CreateContactRequest,
|
||||
GroupNameRequest, UpdateAddressBookRequest, UpdateContactRequest,
|
||||
};
|
||||
use crate::interfaces::api::handlers::dedup_handler::{
|
||||
DedupUploadResponse, HashCheckResponse, StatsResponse,
|
||||
};
|
||||
use crate::interfaces::api::handlers::dedup_handler::{HashCheckResponse, StatsResponse};
|
||||
use crate::interfaces::api::handlers::file_handler::MoveFilePayload;
|
||||
|
||||
#[derive(OpenApi)]
|
||||
@@ -98,7 +96,6 @@ use crate::interfaces::api::handlers::file_handler::MoveFilePayload;
|
||||
handlers::folder_handler::create_folder,
|
||||
handlers::folder_handler::get_folder,
|
||||
handlers::folder_handler::list_root_folders,
|
||||
handlers::folder_handler::list_root_folders_paginated,
|
||||
handlers::folder_handler::list_folder_resources,
|
||||
handlers::folder_handler::rename_folder,
|
||||
handlers::folder_handler::move_folder,
|
||||
@@ -122,7 +119,6 @@ use crate::interfaces::api::handlers::file_handler::MoveFilePayload;
|
||||
handlers::chunked_upload_handler::cancel_upload,
|
||||
// Dedup handlers — all free functions for the same utoipa reason as chunked uploads.
|
||||
handlers::dedup_handler::check_hash,
|
||||
handlers::dedup_handler::upload_with_dedup,
|
||||
handlers::dedup_handler::get_stats,
|
||||
handlers::dedup_handler::get_blob,
|
||||
handlers::dedup_handler::recalculate_stats,
|
||||
@@ -217,9 +213,7 @@ use crate::interfaces::api::handlers::file_handler::MoveFilePayload;
|
||||
handlers::admin_handler::update_user_active,
|
||||
handlers::admin_handler::update_user_quota,
|
||||
handlers::admin_handler::reset_user_password,
|
||||
handlers::admin_handler::get_registration_setting,
|
||||
handlers::admin_handler::set_registration_setting,
|
||||
handlers::admin_handler::get_general_settings,
|
||||
handlers::admin_handler::get_oidc_settings,
|
||||
handlers::admin_handler::save_oidc_settings,
|
||||
handlers::admin_handler::get_storage_settings,
|
||||
@@ -328,7 +322,6 @@ use crate::interfaces::api::handlers::file_handler::MoveFilePayload;
|
||||
UploadStatusResponseDto,
|
||||
// Dedup schemas
|
||||
HashCheckResponse,
|
||||
DedupUploadResponse,
|
||||
StatsResponse,
|
||||
// Contacts / address-book schemas
|
||||
AddressBookResponse,
|
||||
|
||||
Reference in New Issue
Block a user