chore: remove noisy WorkspaceFetch debug logs
This commit is contained in:
@@ -53,7 +53,6 @@ import { buildDraftStoreKey } from "@/stores/draft-keys";
|
|||||||
import type { AttachmentMetadata } from "@/attachments/types";
|
import type { AttachmentMetadata } from "@/attachments/types";
|
||||||
import { reconcilePreviousAgentStatuses } from "@/contexts/session-status-tracking";
|
import { reconcilePreviousAgentStatuses } from "@/contexts/session-status-tracking";
|
||||||
import { isNative } from "@/constants/platform";
|
import { isNative } from "@/constants/platform";
|
||||||
import { summarizeWorkspaceCollection } from "@/utils/workspace-fetch-debug";
|
|
||||||
|
|
||||||
// Re-export types from session-store and draft-store for backward compatibility
|
// Re-export types from session-store and draft-store for backward compatibility
|
||||||
export type { DraftInput } from "@/stores/draft-store";
|
export type { DraftInput } from "@/stores/draft-store";
|
||||||
@@ -334,24 +333,11 @@ function SessionProviderInternal({ children, serverId, client }: SessionProvider
|
|||||||
let includeSubscribe = options?.subscribe ?? false;
|
let includeSubscribe = options?.subscribe ?? false;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
console.log("[WorkspaceFetch][hydrate] request", {
|
|
||||||
serverId,
|
|
||||||
cursor,
|
|
||||||
includeSubscribe,
|
|
||||||
existingWorkspaces: summarizeWorkspaceCollection(existingWorkspaces?.values()),
|
|
||||||
});
|
|
||||||
const payload = await client.fetchWorkspaces({
|
const payload = await client.fetchWorkspaces({
|
||||||
sort: [{ key: "activity_at", direction: "desc" }],
|
sort: [{ key: "activity_at", direction: "desc" }],
|
||||||
...(includeSubscribe ? { subscribe: {} } : {}),
|
...(includeSubscribe ? { subscribe: {} } : {}),
|
||||||
page: cursor ? { limit: 200, cursor } : { limit: 200 },
|
page: cursor ? { limit: 200, cursor } : { limit: 200 },
|
||||||
});
|
});
|
||||||
console.log("[WorkspaceFetch][hydrate] response", {
|
|
||||||
serverId,
|
|
||||||
cursor,
|
|
||||||
includeSubscribe,
|
|
||||||
pageInfo: payload.pageInfo,
|
|
||||||
payload: summarizeWorkspaceCollection(payload.entries),
|
|
||||||
});
|
|
||||||
if (options?.isCancelled?.()) {
|
if (options?.isCancelled?.()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -380,11 +366,6 @@ function SessionProviderInternal({ children, serverId, client }: SessionProvider
|
|||||||
|
|
||||||
setWorkspaces(serverId, workspaces);
|
setWorkspaces(serverId, workspaces);
|
||||||
setHasHydratedWorkspaces(serverId, true);
|
setHasHydratedWorkspaces(serverId, true);
|
||||||
console.log("[WorkspaceFetch][hydrate] applied", {
|
|
||||||
serverId,
|
|
||||||
subscribed: options?.subscribe ?? false,
|
|
||||||
nextWorkspaces: summarizeWorkspaceCollection(workspaces.values()),
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
[client, isConnected, serverId, setHasHydratedWorkspaces, setWorkspaces],
|
[client, isConnected, serverId, setHasHydratedWorkspaces, setWorkspaces],
|
||||||
);
|
);
|
||||||
@@ -1172,10 +1153,6 @@ function SessionProviderInternal({ children, serverId, client }: SessionProvider
|
|||||||
const unsubWorkspaceUpdate = client.on("workspace_update", (message) => {
|
const unsubWorkspaceUpdate = client.on("workspace_update", (message) => {
|
||||||
if (message.type !== "workspace_update") return;
|
if (message.type !== "workspace_update") return;
|
||||||
if (message.payload.kind === "remove") {
|
if (message.payload.kind === "remove") {
|
||||||
console.log("[WorkspaceFetch][update] remove", {
|
|
||||||
serverId,
|
|
||||||
workspaceId: message.payload.id,
|
|
||||||
});
|
|
||||||
removeWorkspace(serverId, message.payload.id);
|
removeWorkspace(serverId, message.payload.id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1183,11 +1160,6 @@ function SessionProviderInternal({ children, serverId, client }: SessionProvider
|
|||||||
const existingWorkspace = useSessionStore
|
const existingWorkspace = useSessionStore
|
||||||
.getState()
|
.getState()
|
||||||
.sessions[serverId]?.workspaces.get(workspace.id);
|
.sessions[serverId]?.workspaces.get(workspace.id);
|
||||||
console.log("[WorkspaceFetch][update] upsert", {
|
|
||||||
serverId,
|
|
||||||
existedInStore: Boolean(existingWorkspace),
|
|
||||||
workspace: summarizeWorkspaceCollection([workspace]),
|
|
||||||
});
|
|
||||||
mergeWorkspaces(serverId, [workspace]);
|
mergeWorkspaces(serverId, [workspace]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -9,10 +9,6 @@ import { useSidebarOrderStore } from "@/stores/sidebar-order-store";
|
|||||||
import type { WorkspaceDescriptor } from "@/stores/session-store";
|
import type { WorkspaceDescriptor } from "@/stores/session-store";
|
||||||
import type { WorkspaceDescriptorPayload } from "@server/shared/messages";
|
import type { WorkspaceDescriptorPayload } from "@server/shared/messages";
|
||||||
import { projectDisplayNameFromProjectId } from "@/utils/project-display-name";
|
import { projectDisplayNameFromProjectId } from "@/utils/project-display-name";
|
||||||
import {
|
|
||||||
summarizeSidebarProjects,
|
|
||||||
summarizeWorkspaceCollection,
|
|
||||||
} from "@/utils/workspace-fetch-debug";
|
|
||||||
|
|
||||||
const EMPTY_ORDER: string[] = [];
|
const EMPTY_ORDER: string[] = [];
|
||||||
const EMPTY_PROJECTS: SidebarProjectEntry[] = [];
|
const EMPTY_PROJECTS: SidebarProjectEntry[] = [];
|
||||||
@@ -293,13 +289,6 @@ export function useSidebarWorkspacesList(options?: {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("[WorkspaceFetch][sidebar] model", {
|
|
||||||
serverId,
|
|
||||||
connectionStatus,
|
|
||||||
hasHydratedWorkspaces,
|
|
||||||
sessionWorkspaces: summarizeWorkspaceCollection(sessionWorkspaces?.values()),
|
|
||||||
projects: summarizeSidebarProjects(projects),
|
|
||||||
});
|
|
||||||
}, [connectionStatus, hasHydratedWorkspaces, projects, serverId, sessionWorkspaces]);
|
}, [connectionStatus, hasHydratedWorkspaces, projects, serverId, sessionWorkspaces]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -345,21 +334,10 @@ export function useSidebarWorkspacesList(options?: {
|
|||||||
let cursor: string | null = null;
|
let cursor: string | null = null;
|
||||||
try {
|
try {
|
||||||
while (true) {
|
while (true) {
|
||||||
console.log("[WorkspaceFetch][sidebar-refresh] request", {
|
|
||||||
serverId,
|
|
||||||
cursor,
|
|
||||||
existingWorkspaces: summarizeWorkspaceCollection(existingWorkspaces?.values()),
|
|
||||||
});
|
|
||||||
const payload = await client.fetchWorkspaces({
|
const payload = await client.fetchWorkspaces({
|
||||||
sort: [{ key: "activity_at", direction: "desc" }],
|
sort: [{ key: "activity_at", direction: "desc" }],
|
||||||
page: cursor ? { limit: 200, cursor } : { limit: 200 },
|
page: cursor ? { limit: 200, cursor } : { limit: 200 },
|
||||||
});
|
});
|
||||||
console.log("[WorkspaceFetch][sidebar-refresh] response", {
|
|
||||||
serverId,
|
|
||||||
cursor,
|
|
||||||
pageInfo: payload.pageInfo,
|
|
||||||
payload: summarizeWorkspaceCollection(payload.entries),
|
|
||||||
});
|
|
||||||
for (const entry of payload.entries) {
|
for (const entry of payload.entries) {
|
||||||
const workspace = toWorkspaceDescriptor(entry);
|
const workspace = toWorkspaceDescriptor(entry);
|
||||||
next.set(
|
next.set(
|
||||||
@@ -378,10 +356,6 @@ export function useSidebarWorkspacesList(options?: {
|
|||||||
const store = useSessionStore.getState();
|
const store = useSessionStore.getState();
|
||||||
store.setWorkspaces(serverId, next);
|
store.setWorkspaces(serverId, next);
|
||||||
store.setHasHydratedWorkspaces(serverId, true);
|
store.setHasHydratedWorkspaces(serverId, true);
|
||||||
console.log("[WorkspaceFetch][sidebar-refresh] applied", {
|
|
||||||
serverId,
|
|
||||||
nextWorkspaces: summarizeWorkspaceCollection(next.values()),
|
|
||||||
});
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("[WorkspaceFetch][sidebar-refresh] failed", {
|
console.error("[WorkspaceFetch][sidebar-refresh] failed", {
|
||||||
serverId,
|
serverId,
|
||||||
|
|||||||
Reference in New Issue
Block a user