: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
fix(today): exclude signals scout runs from the chats recent list (#114940)
posthog[bot]0de453593bfb
diff --git a/frontend/src/layout/today/todaySessionSelectionLogic.test.ts b/frontend/src/layout/today/todaySessionSelectionLogic.test.tsindex d6e9885c6b16..962356c3207b 100644--- a/frontend/src/layout/today/todaySessionSelectionLogic.test.ts+++ b/frontend/src/layout/today/todaySessionSelectionLogic.test.ts@@ -42,6 +42,7 @@ describe('todaySessionSelectionLogic', () => {let logic: ReturnType<typeof todaySessionSelectionLogic.build>let requests: string[]let failingId: string | null+ let listRequests: URLSearchParams[]const write = (label: string, id: string): [number, object] => {requests.push(`${label} ${id}`)@@ -51,6 +52,7 @@ describe('todaySessionSelectionLogic', () => {beforeEach(async () => {requests = []failingId = null+ listRequests = []jest.spyOn(toast, 'success')jest.spyOn(toast, 'error')useMocks({@@ -58,7 +60,9 @@ describe('todaySessionSelectionLogic', () => {'/api/projects/:team_id/task_channels/': [],'/api/projects/:team_id/task_activity/': { results: [] },'/api/projects/:team_id/tasks/': ({ request }) => {- const pinned = new URL(request.url).searchParams.get('pinned')+ const params = new URL(request.url).searchParams+ listRequests.push(params)+ const pinned = params.get('pinned')return [200, { results: pinned ? PINNED : [...PINNED, ...RECENT], count: 3 }]},},@@ -82,6 +86,14 @@ describe('todaySessionSelectionLogic', () => {jest.restoreAllMocks()})+ it('excludes scout runs from Recent but not from Pinned', () => {+ const pinnedRequest = listRequests.find((params) => params.has('pinned'))+ const recentRequest = listRequests.find((params) => params.has('created_by'))++ expect(recentRequest?.get('exclude_origin_product')).toBe('signals_scout')+ expect(pinnedRequest?.has('exclude_origin_product')).toBe(false)+ })+it.each([['pin', () => logic.actions.pinSelected()],['archive', () => logic.actions.requestBulkArchive()],diff --git a/frontend/src/layout/today/todaySpacesLogic.ts b/frontend/src/layout/today/todaySpacesLogic.tsindex d46390686c27..3e5d44de5708 100644--- a/frontend/src/layout/today/todaySpacesLogic.ts+++ b/frontend/src/layout/today/todaySpacesLogic.ts@@ -29,6 +29,7 @@ import {TaskActivityDTOApi,TaskActivityReadMarkerApi,TaskListItemApi,+ TasksListExcludeOriginProduct,} from 'products/tasks/frontend/generated/api.schemas'import { pullRequestStates, sessionIdsWithPullRequests } from 'products/tasks/frontend/spaces/taskPullRequests'@@ -419,6 +420,8 @@ export const todaySpacesLogic = kea<todaySpacesLogicType>([}const response = await tasksList(String(values.currentTeamId), {created_by: values.user.id,+ // Scout runs execute as their author and would fill the capped list.+ exclude_origin_product: TasksListExcludeOriginProduct.SignalsScout,ordering: '-last_activity_at',basic: true,limit: RECENT_SESSION_LIMIT,