From d51f2793e924dd3ebdfcb9492fb18cdb256f096b Mon Sep 17 00:00:00 2001 From: perf3ct Date: Mon, 16 Jun 2025 17:10:55 +0000 Subject: [PATCH] feat(server/client): update function used to display singular documents --- frontend/src/services/api.ts | 4 ++-- src/source_sync.rs | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/src/services/api.ts b/frontend/src/services/api.ts index e98a9d8..eeb3442 100644 --- a/frontend/src/services/api.ts +++ b/frontend/src/services/api.ts @@ -124,13 +124,13 @@ export const documentService = { getById: (id: string) => { // Use the document list endpoint with pagination to find the specific document // This is a temporary solution until we have a proper document details endpoint - return api.get('/documents', { + return api.get>('/documents', { params: { limit: 1000, // Fetch a reasonable amount to find our document offset: 0 } }).then(response => { - const document = response.data.find(doc => doc.id === id); + const document = response.data.documents.find(doc => doc.id === id); if (!document) { throw new Error('Document not found'); } diff --git a/src/source_sync.rs b/src/source_sync.rs index fd7d5b2..7757e3d 100644 --- a/src/source_sync.rs +++ b/src/source_sync.rs @@ -99,13 +99,15 @@ impl SourceSyncService { info!("WebDAV source sync config: server_url={}, username={}, watch_folders={:?}, file_extensions={:?}, server_type={:?}", config.server_url, config.username, config.watch_folders, config.file_extensions, config.server_type); + // Requests to list files in a Nextcloud folder might take > 2 minutes + // Set timeout to 3 minutes to accommodate large folder structures let webdav_config = WebDAVConfig { server_url: config.server_url, username: config.username, password: config.password, watch_folders: config.watch_folders, file_extensions: config.file_extensions, - timeout_seconds: 30, + timeout_seconds: 180, // 3 minutes for discover_files_in_folder operations server_type: config.server_type, };