Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useQuery } from "@tanstack/react-query";
import { callAPIWithETag } from "../../../features/projects/shared/apiWithEtag";
import { callAPIWithETag } from "../../../features/shared/apiWithEtag";
import type { HealthResponse } from "../types";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Uses ETag support for efficient polling
*/

import { callAPIWithETag } from "../../../projects/shared/apiWithEtag";
import { callAPIWithETag } from "../../../shared/apiWithEtag";
import type { ActiveOperationsResponse, ProgressResponse } from "../types";

export const progressService = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Handles all knowledge-related API operations using TanStack Query patterns
*/

import { callAPIWithETag, invalidateETagCache } from "../../projects/shared/apiWithEtag";
import { callAPIWithETag } from "../../shared/apiWithEtag";
import type {
ChunksResponse,
CodeExamplesResponse,
Expand Down Expand Up @@ -58,10 +58,6 @@ export const knowledgeService = {
method: "DELETE",
});

// Invalidate cache after deletion
invalidateETagCache("/api/knowledge-items");
invalidateETagCache("/api/knowledge-items/summary");
invalidateETagCache(`/api/knowledge-items/${sourceId}`);

return response;
},
Expand All @@ -75,10 +71,6 @@ export const knowledgeService = {
body: JSON.stringify(updates),
});

// Invalidate both list and specific item cache
invalidateETagCache("/api/knowledge-items");
invalidateETagCache("/api/knowledge-items/summary");
invalidateETagCache(`/api/knowledge-items/${sourceId}`);

return response;
},
Expand All @@ -92,9 +84,6 @@ export const knowledgeService = {
body: JSON.stringify(request),
});

// Invalidate list cache as new item will be added
invalidateETagCache("/api/knowledge-items");
invalidateETagCache("/api/knowledge-items/summary");

return response;
},
Expand All @@ -107,10 +96,6 @@ export const knowledgeService = {
method: "POST",
});

// Invalidate caches
invalidateETagCache("/api/knowledge-items");
invalidateETagCache("/api/knowledge-items/summary");
invalidateETagCache(`/api/knowledge-items/${sourceId}`);

return response;
},
Expand Down Expand Up @@ -152,9 +137,6 @@ export const knowledgeService = {
throw new Error(error.error || `HTTP ${response.status}`);
}

// Invalidate list cache
invalidateETagCache("/api/knowledge-items");
invalidateETagCache("/api/knowledge-items/summary");

return response.json();
},
Expand Down
2 changes: 1 addition & 1 deletion archon-ui-main/src/features/mcp/services/mcpApi.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { callAPIWithETag } from "../../projects/shared/apiWithEtag";
import { callAPIWithETag } from "../../shared/apiWithEtag";
import type { McpClient, McpServerConfig, McpServerStatus, McpSessionInfo } from "../types";

export const mcpApi = {
Expand Down
10 changes: 1 addition & 9 deletions archon-ui-main/src/features/projects/services/projectService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { validateCreateProject, validateUpdateProject } from "../schemas";
import { formatRelativeTime, formatZodErrors, ValidationError } from "../shared/api";
import { callAPIWithETag, invalidateETagCache } from "../shared/apiWithEtag";
import { callAPIWithETag } from "../../shared/apiWithEtag";
import type { CreateProjectRequest, Project, ProjectFeatures, UpdateProjectRequest } from "../types";

export const projectService = {
Expand Down Expand Up @@ -93,8 +93,6 @@ export const projectService = {
body: JSON.stringify(validation.data),
});

// Invalidate project list cache after creation
invalidateETagCache("/api/projects");

// Project creation response received
return response;
Expand Down Expand Up @@ -129,9 +127,6 @@ export const projectService = {
body: JSON.stringify(validation.data),
});

// Invalidate caches after update
invalidateETagCache("/api/projects");
invalidateETagCache(`/api/projects/${projectId}`);

// API update response received

Expand Down Expand Up @@ -161,9 +156,6 @@ export const projectService = {
method: "DELETE",
});

// Invalidate caches after deletion
invalidateETagCache("/api/projects");
invalidateETagCache(`/api/projects/${projectId}`);
} catch (error) {
console.error(`Failed to delete project ${projectId}:`, error);
throw error;
Expand Down
224 changes: 0 additions & 224 deletions archon-ui-main/src/features/projects/shared/apiWithEtag.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import { formatZodErrors, ValidationError } from "../../shared/api";
import { callAPIWithETag, invalidateETagCache } from "../../shared/apiWithEtag";
import { callAPIWithETag } from "../../../shared/apiWithEtag";

import { validateCreateTask, validateUpdateTask, validateUpdateTaskStatus } from "../schemas";
import type { CreateTaskRequest, DatabaseTaskStatus, Task, TaskCounts, UpdateTaskRequest } from "../types";
Expand Down Expand Up @@ -57,9 +57,6 @@ export const taskService = {
body: JSON.stringify(requestData),
});

// Invalidate task list cache for the project
invalidateETagCache(`/api/projects/${taskData.project_id}/tasks`);
invalidateETagCache("/api/tasks/counts");

return task;
} catch (error) {
Expand All @@ -84,9 +81,6 @@ export const taskService = {
body: JSON.stringify(validation.data),
});

// Invalidate related caches
// Note: We don't know the project_id here, so TanStack Query will handle invalidation
invalidateETagCache("/api/tasks/counts");

return task;
} catch (error) {
Expand Down Expand Up @@ -115,8 +109,6 @@ export const taskService = {
body: JSON.stringify({ status }),
});

// Invalidate task counts cache when status changes
invalidateETagCache("/api/tasks/counts");

return task;
} catch (error) {
Expand All @@ -134,8 +126,6 @@ export const taskService = {
method: "DELETE",
});

// Invalidate task counts cache after deletion
invalidateETagCache("/api/tasks/counts");
} catch (error) {
console.error(`Failed to delete task ${taskId}:`, error);
throw error;
Expand Down
Loading