:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
perf(desktop): drop task descriptions from full-list fetches (#96643)
Paul D'Ambraf653678fd679
diff --git a/products/desktop/packages/api-client/src/posthog-client.test.ts b/products/desktop/packages/api-client/src/posthog-client.test.tsindex 139273528ec8..3742a07609eb 100644--- a/products/desktop/packages/api-client/src/posthog-client.test.ts+++ b/products/desktop/packages/api-client/src/posthog-client.test.ts@@ -567,6 +567,7 @@ describe("PostHogAPIClient", () => {["pinned", { pinned: true }, "pinned", "true"],["commented-by", { commentedBy: 17 }, "commented_by", "17"],["mentions", { mentions: 19 }, "mentions", "19"],+ ["basic summary", { basic: true }, "basic", "true"],])("sends the %s task-list filter", async (_name, options, param, value) => {const fetch = vi.fn().mockResolvedValue(new Response(JSON.stringify({ results: [], count: 0 }), {@@ -588,6 +589,29 @@ describe("PostHogAPIClient", () => {expect(url.searchParams.get(param)).toBe(value);});+ it.each([undefined, { basic: false }])(+ "omits basic unless the caller asks for the summary payload (%o)",+ async (options) => {+ const fetch = vi.fn().mockResolvedValue(+ new Response(JSON.stringify({ results: [], count: 0 }), {+ status: 200,+ }),+ );+ const client = new PostHogAPIClient(+ "https://app.posthog.test",+ async () => "token",+ async () => "token",+ 42,+ { fetch },+ );++ await client.getTasksPage(options);++ const url = fetch.mock.calls[0][0] as URL;+ expect(url.searchParams.has("basic")).toBe(false);+ },+ );+it.each(["user_message","permission_response",diff --git a/products/desktop/packages/api-client/src/posthog-client.ts b/products/desktop/packages/api-client/src/posthog-client.tsindex 8a6c8479f451..bb16616f23d8 100644--- a/products/desktop/packages/api-client/src/posthog-client.ts+++ b/products/desktop/packages/api-client/src/posthog-client.ts@@ -296,6 +296,12 @@ export interface TaskListOptions {channel?: string;/** Case-insensitive substring match over task title, description, and number. */search?: string;+ /**+ * Ask for the basic list payload: a summary shape with heavy fields dropped. Defaults to+ * false. A surface that does not render the description sets this to skip the field that+ * dominates the list payload.+ */+ basic?: boolean;/** Filter by the status of the task's most recent run. */status?: string;/** Filter by the state of the latest run's pull request (open/draft/merged/closed). */@@ -3027,6 +3033,10 @@ export class PostHogAPIClient {params.ordering = options.ordering;}+ if (options?.basic) {+ params.basic = true;+ }+const data = await this.api.get(`/api/projects/{project_id}/tasks/`, {path: { project_id: teamId.toString() },query: params,diff --git a/products/desktop/packages/ui/src/features/tasks/useTasks.ts b/products/desktop/packages/ui/src/features/tasks/useTasks.tsindex d22e830cf456..ef7fc3a00f9a 100644--- a/products/desktop/packages/ui/src/features/tasks/useTasks.ts+++ b/products/desktop/packages/ui/src/features/tasks/useTasks.ts@@ -38,6 +38,9 @@ export function useTasks(repository: filters?.repository,createdBy,internal,+ // The sidebar and every other full-list consumer narrow the task before use+ // and never read its description, so ask for the basic payload without it.+ basic: true,}) as unknown as Promise<Task[]>,{enabled: (options?.enabled ?? true) && !!currentUser?.id,@@ -77,6 +80,8 @@ export function useSlackTasks(options?: {client.getTasks({originProduct: "slack",internal,+ // Only slack origin/thread fields are read off these rows; ask for the basic payload.+ basic: true,}) as unknown as Promise<Task[]>,{enabled: options?.enabled ?? true,