: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(customer-analytics): Paginate accounts list past 100 rows (#68207)
Arthur Moreira de Deusa8d980e6a5f8
diff --git a/frontend/src/queries/nodes/DataNode/dataNodeLogic.test.ts b/frontend/src/queries/nodes/DataNode/dataNodeLogic.test.tsindex 54851445292f..f9126c255d8d 100644--- a/frontend/src/queries/nodes/DataNode/dataNodeLogic.test.ts+++ b/frontend/src/queries/nodes/DataNode/dataNodeLogic.test.ts@@ -335,6 +335,29 @@ describe('dataNodeLogic', () => {})})+ it('can load next data for AccountsQuery', async () => {+ logic = dataNodeLogic({+ key: testUniqueKey,+ query: setLatestVersionsOnQuery({ kind: NodeKind.AccountsQuery }),+ })+ const results = [[{}], [{}], [{}]]+ mockedQuery.mockResolvedValueOnce({ results, hasMore: true })+ logic.mount()+ await expectLogic(logic)+ .toMatchValues({ responseLoading: true, canLoadNextData: false, nextQuery: null, response: null })+ .delay(0)+ await expectLogic(logic).toMatchValues({+ responseLoading: false,+ canLoadNextData: true,+ nextQuery: setLatestVersionsOnQuery({+ kind: NodeKind.AccountsQuery,+ limit: 100,+ offset: 3,+ }),+ response: partial({ results }),+ })+ })+it('can autoload new data for EventsQuery', async () => {const results = [[diff --git a/frontend/src/queries/nodes/DataNode/dataNodeLogic.ts b/frontend/src/queries/nodes/DataNode/dataNodeLogic.tsindex ae37479b9258..18044995b0c1 100644--- a/frontend/src/queries/nodes/DataNode/dataNodeLogic.ts+++ b/frontend/src/queries/nodes/DataNode/dataNodeLogic.ts@@ -37,6 +37,8 @@ import {ActorsQueryResponse,AnyResponseType,DashboardFilter,+ AccountsQuery,+ AccountsQueryResponse,DataNode,DataVisualizationNode,ErrorTrackingQuery,@@ -63,6 +65,7 @@ import {TracesQueryResponse,} from '~/queries/schema/schema-general'import {+ isAccountsQuery,isActorsQuery,isErrorTrackingQuery,isEventsQuery,@@ -456,7 +459,8 @@ export const dataNodeLogic = kea<dataNodeLogicType>([isTracesQuery(props.query) ||isErrorTrackingQuery(props.query) ||isSessionsQuery(props.query) ||- isMarketingAnalyticsTableQuery(props.query)+ isMarketingAnalyticsTableQuery(props.query) ||+ isAccountsQuery(props.query)) {const newResponse =(await performQuery(@@ -479,6 +483,7 @@ export const dataNodeLogic = kea<dataNodeLogicType>([| TracesQueryResponse| SessionsQueryResponse| MarketingAnalyticsTableQueryResponse+ | AccountsQueryResponselet results = [...(queryResponse?.results ?? []), ...(newResponse?.results ?? [])]@@ -825,7 +830,8 @@ export const dataNodeLogic = kea<dataNodeLogicType>([isErrorTrackingQuery(query) ||isTracesQuery(query) ||isSessionsQuery(query) ||- isMarketingAnalyticsTableQuery(query)) &&+ isMarketingAnalyticsTableQuery(query) ||+ isAccountsQuery(query)) &&!responseError &&!dataLoading) {@@ -839,6 +845,7 @@ export const dataNodeLogic = kea<dataNodeLogicType>([| TracesQueryResponse| SessionsQueryResponse| MarketingAnalyticsTableQueryResponse+ | AccountsQueryResponse)?.hasMore) {const sortKey = isTracesQuery(query) ? null : (query.orderBy?.[0] ?? 'timestamp DESC')@@ -871,6 +878,7 @@ export const dataNodeLogic = kea<dataNodeLogicType>([| TracesQueryResponse| SessionsQueryResponse| MarketingAnalyticsTableQueryResponse+ | AccountsQueryResponse)?.resultsreturn {...query,@@ -887,6 +895,7 @@ export const dataNodeLogic = kea<dataNodeLogicType>([| TracesQuery| SessionsQuery| MarketingAnalyticsTableQuery+ | AccountsQuery}}}