Skip to content

: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.

fix(error-tracking): accept deprecated useQueryV2/useQueryV3 query flags (#63299)

Hugues Pouillot972219f3db0d
diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.json
index a90ae6e4d2cc..5f9b6b8e76de 100644
--- a/frontend/src/queries/schema.json
+++ b/frontend/src/queries/schema.json
@@ -17328,6 +17328,14 @@
"tags": {
"$ref": "#/definitions/QueryLogTags"
},
+ "useQueryV2": {
+ "deprecated": "Ignored — V2 query path was removed. Kept so requests from older clients still validate.",
+ "type": "boolean"
+ },
+ "useQueryV3": {
+ "deprecated": "Ignored — V3 is the only query path. Kept so requests from older clients still validate.",
+ "type": "boolean"
+ },
"version": {
"description": "version of the node, used for schema migrations",
"type": "number"
diff --git a/frontend/src/queries/schema/schema-general.ts b/frontend/src/queries/schema/schema-general.ts
index b9fbf0a3ccf9..017f6797144a 100644
--- a/frontend/src/queries/schema/schema-general.ts
+++ b/frontend/src/queries/schema/schema-general.ts
@@ -2794,6 +2794,10 @@ export interface ErrorTrackingQuery extends DataNode<ErrorTrackingQueryResponse>
personId?: string
groupKey?: string
groupTypeIndex?: integer
+ /** @deprecated Ignored — V2 query path was removed. Kept so requests from older clients still validate. */
+ useQueryV2?: boolean
+ /** @deprecated Ignored — V3 is the only query path. Kept so requests from older clients still validate. */
+ useQueryV3?: boolean
/**
* Pending fingerprint issue state updates UNIONed into the fingerprint issue state subquery.
* The backend caps the list at 50 entries; extras are dropped silently.
diff --git a/posthog/schema.py b/posthog/schema.py
index d6b36a3be399..9c71ef65151f 100644
--- a/posthog/schema.py
+++ b/posthog/schema.py
@@ -22373,6 +22373,8 @@ class ErrorTrackingQuery(BaseModel):
title="ErrorTrackingQueryStatus",
)
tags: QueryLogTags | None = None
+ useQueryV2: bool | None = None
+ useQueryV3: bool | None = None
version: float | None = Field(default=None, description="version of the node, used for schema migrations")
volumeResolution: int
withAggregations: bool | None = None
diff --git a/products/dashboards/frontend/generated/api.schemas.ts b/products/dashboards/frontend/generated/api.schemas.ts
index 6a09347f6071..48fce477300b 100644
--- a/products/dashboards/frontend/generated/api.schemas.ts
+++ b/products/dashboards/frontend/generated/api.schemas.ts
@@ -6826,6 +6826,8 @@ export interface ErrorTrackingQueryApi {
/** Filter by issue status. */
status?: ErrorTrackingIssueStatusApi | string | null
tags?: QueryLogTagsApi | null
+ useQueryV2?: boolean | null
+ useQueryV3?: boolean | null
/** version of the node, used for schema migrations */
version?: number | null
volumeResolution: number
diff --git a/products/error_tracking/backend/hogql_queries/test/test_query_schema_compat.py b/products/error_tracking/backend/hogql_queries/test/test_query_schema_compat.py
new file mode 100644
index 000000000000..3e55e9e629a4
--- /dev/null
+++ b/products/error_tracking/backend/hogql_queries/test/test_query_schema_compat.py
@@ -0,0 +1,25 @@
+from django.test import SimpleTestCase
+
+from parameterized import parameterized
+
+from posthog.schema import QueryRequest
+
+
+class TestErrorTrackingQuerySchemaCompat(SimpleTestCase):
+ # Older frontend bundles still send the deprecated query-path flags. The schema must
+ # keep accepting them until no clients send them anymore — removing them breaks every
+ # stale tab with a hard 400 during deploys (extra="forbid").
+ @parameterized.expand([("useQueryV2", False), ("useQueryV3", True)])
+ def test_accepts_deprecated_query_path_flags(self, flag: str, value: bool) -> None:
+ request = QueryRequest.model_validate(
+ {
+ "query": {
+ "kind": "ErrorTrackingQuery",
+ "orderBy": "last_seen",
+ "dateRange": {"date_from": "-7d"},
+ "volumeResolution": 20,
+ flag: value,
+ }
+ }
+ )
+ assert getattr(request.query, flag) == value
diff --git a/products/product_analytics/frontend/generated/api.schemas.ts b/products/product_analytics/frontend/generated/api.schemas.ts
index 5d4f1608704a..5f57a18920e4 100644
--- a/products/product_analytics/frontend/generated/api.schemas.ts
+++ b/products/product_analytics/frontend/generated/api.schemas.ts
@@ -6361,6 +6361,8 @@ export interface ErrorTrackingQueryApi {
/** Filter by issue status. */
status?: ErrorTrackingIssueStatusApi | string | null
tags?: QueryLogTagsApi | null
+ useQueryV2?: boolean | null
+ useQueryV3?: boolean | null
/** version of the node, used for schema migrations */
version?: number | null
volumeResolution: number
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 1174f961872a..99ab582fc14d 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -6248,6 +6248,8 @@ export namespace Schemas {
/** Filter by issue status. */
status?: ErrorTrackingIssueStatus | string | null;
tags?: QueryLogTags | null;
+ useQueryV2?: boolean | null;
+ useQueryV3?: boolean | null;
/** version of the node, used for schema migrations */
version?: number | null;
volumeResolution: number;