: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(error-tracking): resolve singular exception releases (#81693)
Hugues Pouillot16fd06188a7a
diff --git a/frontend/src/lib/components/Errors/errorPropertiesLogic.ts b/frontend/src/lib/components/Errors/errorPropertiesLogic.tsindex 193856b2b489..ae40ef38d91a 100644--- a/frontend/src/lib/components/Errors/errorPropertiesLogic.ts+++ b/frontend/src/lib/components/Errors/errorPropertiesLogic.ts@@ -13,6 +13,7 @@ import {getAdditionalProperties,getExceptionAttributes,getExceptionList,+ getExceptionRelease,getFingerprintRecords,getRecordingStatus,getSessionId,@@ -87,6 +88,7 @@ export interface errorPropertiesLogicMeta {uuid: (id: string) => stringframesStoredCrashFirst: (properties: Record<string, any>, arg: string | undefined) => booleanrelease: (+ properties: Record<string, any>,frames: ErrorTrackingStackFrame[],stackFrameRecords: KeyedStackFrameRecords) => ErrorTrackingRelease | null | undefined@@ -175,8 +177,19 @@ export const errorPropertiesLogic = kea<errorPropertiesLogicType>([isStoredCrashFirst(properties?.['$lib'] as string | undefined, timestamp),],release: [- (s) => [s.frames, s.stackFrameRecords],- (frames: ErrorTrackingStackFrame[], stackFrameRecords: KeyedStackFrameRecords) => {+ (s) => [s.properties, s.frames, s.stackFrameRecords],+ (+ properties: ErrorEventProperties,+ frames: ErrorTrackingStackFrame[],+ stackFrameRecords: KeyedStackFrameRecords+ ) => {+ const eventRelease = properties ? getExceptionRelease(properties) : undefined+ if (eventRelease) {+ return eventRelease+ }++ // Fall back to frame releases for exception events captured before Cymbal started+ // writing the singular event-level release property.if (!frames.length || Object.keys(stackFrameRecords).length === 0) {return undefined}diff --git a/frontend/src/lib/components/Errors/utils.test.ts b/frontend/src/lib/components/Errors/utils.test.tsindex 36d12f3d4fc7..f8ef41b9468c 100644--- a/frontend/src/lib/components/Errors/utils.test.ts+++ b/frontend/src/lib/components/Errors/utils.test.ts@@ -1,5 +1,5 @@import { ErrorEventProperties, ExceptionAttributes } from './types'-import { getExceptionAttributes, getExceptionList, getSessionId } from './utils'+import { getExceptionAttributes, getExceptionList, getExceptionRelease, getSessionId } from './utils'describe('Error Display', () => {it('can read sentry stack trace when $exception_list is not present', () => {@@ -189,4 +189,43 @@ describe('Error Display', () => {])('getSessionId normalizes %s', (_name, properties, expected) => {expect(getSessionId(properties as ErrorEventProperties)).toEqual(expected)})++ it('normalizes the singular exception release property', () => {+ const release = getExceptionRelease({+ $exception_release: {+ id: '019aca26-0a47-776c-baa2-0afbec3ec7bb',+ version: '1.2.3',+ project: 'com.example.app',+ timestamp: '2026-08-04T10:00:00Z',+ metadata: {+ git: {+ commit_id: 'abcdef123456',+ },+ },+ },+ } as ErrorEventProperties)++ expect(release).toEqual({+ id: '019aca26-0a47-776c-baa2-0afbec3ec7bb',+ version: '1.2.3',+ project: 'com.example.app',+ created_at: '2026-08-04T10:00:00Z',+ metadata: {+ git: {+ commit_id: 'abcdef123456',+ },+ },+ })+ })++ it.each([+ ['missing release', {}],+ ['legacy plural release map', { $exception_releases: { release: { version: '1.2.3' } } }],+ ['non-object release', { $exception_release: '1.2.3' }],+ ['release without an id', { $exception_release: { version: '1.2.3', timestamp: '2026-08-04' } }],+ ['release without a version', { $exception_release: { id: 'release-id', timestamp: '2026-08-04' } }],+ ['release without a timestamp', { $exception_release: { id: 'release-id', version: '1.2.3' } }],+ ])('ignores an invalid %s', (_name, properties) => {+ expect(getExceptionRelease(properties as ErrorEventProperties)).toBeUndefined()+ })})diff --git a/frontend/src/lib/components/Errors/utils.ts b/frontend/src/lib/components/Errors/utils.tsindex 50b873359a80..7b448adff77b 100644--- a/frontend/src/lib/components/Errors/utils.ts+++ b/frontend/src/lib/components/Errors/utils.ts@@ -5,6 +5,7 @@ import { isPostHogProperty } from '~/taxonomy/taxonomy'import {ErrorEventProperties,ErrorTrackingException,+ ErrorTrackingRelease,ErrorTrackingRuntime,ErrorTrackingStackFrame,ExceptionAttributes,@@ -194,6 +195,39 @@ export function getRecordingStatus(properties: ErrorEventProperties): string | ureturn properties['$recording_status'] as string | undefined}+/**+ * Normalize Cymbal's event-level release snapshot to the release API shape used by the UI.+ * The event property uses `timestamp`, while release API responses use `created_at`.+ */+export function getExceptionRelease(properties: ErrorEventProperties): ErrorTrackingRelease | undefined {+ const release: unknown = properties['$exception_release']+ if (!release || typeof release !== 'object' || Array.isArray(release)) {+ return undefined+ }++ const candidate = release as Record<string, unknown>+ if (+ typeof candidate.id !== 'string' ||+ typeof candidate.version !== 'string' ||+ typeof candidate.timestamp !== 'string'+ ) {+ return undefined+ }++ const metadata =+ candidate.metadata && typeof candidate.metadata === 'object' && !Array.isArray(candidate.metadata)+ ? (candidate.metadata as ErrorTrackingRelease['metadata'])+ : undefined++ return {+ id: candidate.id,+ version: candidate.version,+ created_at: candidate.timestamp,+ project: typeof candidate.project === 'string' ? candidate.project : undefined,+ metadata,+ }+}+// we had a bug where SDK was sending non-string values for exception valuefunction ensureStringExceptionValues(exceptionList: ErrorTrackingException[]): ErrorTrackingException[] {if (!Array.isArray(exceptionList)) {diff --git a/frontend/src/taxonomy/core-filter-definitions-by-group.json b/frontend/src/taxonomy/core-filter-definitions-by-group.jsonindex e8d95976564f..51cfacd74b56 100644--- a/frontend/src/taxonomy/core-filter-definitions-by-group.json+++ b/frontend/src/taxonomy/core-filter-definitions-by-group.json@@ -1550,9 +1550,9 @@"label": "Exception list","system": true},- "$exception_releases": {- "description": "The releases in which this exception has been observed.",- "label": "Exception releases",+ "$exception_release": {+ "description": "The release associated with this exception event.",+ "label": "Exception release","type": "String"},"$exception_source": {@@ -5989,9 +5989,9 @@"label": "Exception list","system": true},- "$exception_releases": {- "description": "The releases in which this exception has been observed.",- "label": "Exception releases",+ "$exception_release": {+ "description": "The release associated with this exception event.",+ "label": "Exception release","type": "String"},"$exception_source": {diff --git a/posthog/taxonomy/taxonomy.py b/posthog/taxonomy/taxonomy.pyindex fd6bbb7db5b9..243e2f952757 100644--- a/posthog/taxonomy/taxonomy.py+++ b/posthog/taxonomy/taxonomy.py@@ -3329,9 +3329,9 @@ CORE_FILTER_DEFINITIONS_BY_GROUP: dict[str, dict[str, CoreFilterDefinition]] = {"description": "The description of the error tracking issue this exception belongs to.","type": "String",},- "$exception_releases": {- "label": "Exception releases",- "description": "The releases in which this exception has been observed.",+ "$exception_release": {+ "label": "Exception release",+ "description": "The release associated with this exception event.","type": "String",},"$debug_images": {diff --git a/products/error_tracking/frontend/__mocks__/events/java_long.json b/products/error_tracking/frontend/__mocks__/events/java_long.jsonindex 29cd9c63b31f..a691e8831e09 100644--- a/products/error_tracking/frontend/__mocks__/events/java_long.json+++ b/products/error_tracking/frontend/__mocks__/events/java_long.json@@ -470,18 +470,17 @@"$app_build": 1,"$process_person_profile": false,"$exception_handled": true,- "$exception_releases": {- "91731dae7b53a1ec38467f3f813ae6d790a2b62c1a6f5607c7378dcf752168dbdfd48990d6e1647e5bb10a12b00f6d2f36d409967e99dbf1609166d665fa5452": {- "version": "bd1373f1b02ffb849572aa5d953b223c142b0e0f",- "project": "posthog-android",- "timestamp": "2025-11-28T11:07:55.159862Z",- "metadata": {- "git": {- "branch": "chore/progaurd-support",- "commit_id": "bd1373f1b02ffb849572aa5d953b223c142b0e0f",- "remote_url": "[email protected]:PostHog/posthog-android.git",- "repo_name": "posthog-android"- }+ "$exception_release": {+ "id": "019aca26-0a47-776c-baa2-0afbec3ec7bb",+ "version": "bd1373f1b02ffb849572aa5d953b223c142b0e0f",+ "project": "posthog-android",+ "timestamp": "2025-11-28T11:07:55.159862Z",+ "metadata": {+ "git": {+ "branch": "chore/progaurd-support",+ "commit_id": "bd1373f1b02ffb849572aa5d953b223c142b0e0f",+ "remote_url": "[email protected]:PostHog/posthog-android.git",+ "repo_name": "posthog-android"}}},diff --git a/products/error_tracking/frontend/components/ExceptionAttributesPreview/ReleasesPreview/releasePreviewLogic.ts b/products/error_tracking/frontend/components/ExceptionAttributesPreview/ReleasesPreview/releasePreviewLogic.tsdeleted file mode 100644index 5347ae5658ba..000000000000--- a/products/error_tracking/frontend/components/ExceptionAttributesPreview/ReleasesPreview/releasePreviewLogic.ts+++ /dev/null@@ -1,83 +0,0 @@-import { MakeLogicType, connect, kea, path, props, selectors } from 'kea'--import { ErrorPropertiesLogicProps, errorPropertiesLogic } from 'lib/components/Errors/errorPropertiesLogic'-import { ErrorTrackingRelease } from 'lib/components/Errors/types'-import { dayjs } from 'lib/dayjs'--import type { KeyedStackFrameRecords } from '../../../../../../frontend/src/lib/components/Errors/Frame/stackFrameLogic'-import type { ErrorTrackingStackFrame } from '../../../../../../frontend/src/lib/components/Errors/types'--// Generated by kea-typegen. Update if you're an agent, ignore if you're human.-export interface releasePreviewLogicValues {- frames: ErrorTrackingStackFrame[] // errorPropertiesLogic- stackFrameRecords: KeyedStackFrameRecords // errorPropertiesLogic- release: ErrorTrackingRelease | null | undefined-}--// Generated by kea-typegen. Update if you're an agent, ignore if you're human.-export interface releasePreviewLogicMeta {- __keaTypeGenInternalSelectorTypes: {- release: (- frames: ErrorTrackingStackFrame[],- stackFrameRecords: KeyedStackFrameRecords- ) => ErrorTrackingRelease | null | undefined- }-}--export type releasePreviewLogicType = MakeLogicType<- releasePreviewLogicValues,- {},- ErrorPropertiesLogicProps,- releasePreviewLogicMeta->--export const releasePreviewLogic = kea<releasePreviewLogicType>([- path([- 'products',- 'error_tracking',- 'frontend',- 'components',- 'ExceptionAttributesPreview',- 'ReleasesPreview',- 'releasePreviewLogic',- ]),-- props({} as ErrorPropertiesLogicProps),-- connect((props: ErrorPropertiesLogicProps) => ({- values: [errorPropertiesLogic(props), ['frames', 'stackFrameRecords']],- })),-- selectors(() => ({- release: [- (s) => [s.frames, s.stackFrameRecords],- (- frames: import('lib/components/Errors/types').ErrorTrackingStackFrame[],- stackFrameRecords: import('lib/components/Errors/Frame/stackFrameLogic').KeyedStackFrameRecords- ) => {- if (!frames.length || Object.keys(stackFrameRecords).length === 0) {- return undefined- }- const rawIds = frames.map((f) => f.raw_id)- const relatedReleases: ErrorTrackingRelease[] = rawIds- .map((id) => stackFrameRecords[id]?.release)- .filter((r) => !!r) as ErrorTrackingRelease[]-- const uniqueRelatedReleasesIds = [...new Set(relatedReleases.map((r) => r?.id))]- if (uniqueRelatedReleasesIds.length === 1) {- return relatedReleases[0]- }- // canonical storage order: the crash site is the last frame- const kaboomFrame = frames[frames.length - 1]- if (stackFrameRecords[kaboomFrame?.raw_id]?.release) {- return stackFrameRecords[kaboomFrame.raw_id].release- }- // get most recent release- const sortedReleases = relatedReleases.sort(- (a, b) => dayjs(b.created_at).unix() - dayjs(a.created_at).unix()- )- return sortedReleases[0]- },- ],- })),-])diff --git a/products/error_tracking/frontend/components/ExceptionCard/ExceptionCard.tsx b/products/error_tracking/frontend/components/ExceptionCard/ExceptionCard.tsxindex 238b79dac7c6..c6f92dd9b5ad 100644--- a/products/error_tracking/frontend/components/ExceptionCard/ExceptionCard.tsx+++ b/products/error_tracking/frontend/components/ExceptionCard/ExceptionCard.tsx@@ -9,7 +9,6 @@ import { ErrorEventType } from 'lib/components/Errors/types'import { TZLabel } from 'lib/components/TZLabel'import { TabsPrimitive, TabsPrimitiveList, TabsPrimitiveTrigger } from 'lib/ui/TabsPrimitive/TabsPrimitive'-import { releasePreviewLogic } from '../ExceptionAttributesPreview/ReleasesPreview/releasePreviewLogic'import { exceptionCardLogic } from './exceptionCardLogic'import { PropertiesTab } from './Tabs/PropertiesTab'import { SessionTab } from './Tabs/SessionTab'@@ -59,9 +58,7 @@ export function ExceptionCard({return (<BindLogic logic={exceptionCardLogic} props={cardLogicProps}><BindLogic logic={errorPropertiesLogic} props={eventProps}>- <BindLogic logic={releasePreviewLogic} props={eventProps}>- <ExceptionCardContent timestamp={event?.timestamp} {...contentProps} />- </BindLogic>+ <ExceptionCardContent timestamp={event?.timestamp} {...contentProps} /></BindLogic></BindLogic>)diff --git a/rust/property-defs-rs/src/api/v1/constants.rs b/rust/property-defs-rs/src/api/v1/constants.rsindex e56461cfdf84..a23c4cc259bf 100644--- a/rust/property-defs-rs/src/api/v1/constants.rs+++ b/rust/property-defs-rs/src/api/v1/constants.rs@@ -118,7 +118,7 @@ pub static PROPERTY_DEFINITION_ALIASES: [(&str, &str); 243] = [),("$exception_issue_id", "exception issue id"),("$exception_source", "exception capture source"),- ("$exception_releases", "exception releases"),+ ("$exception_release", "exception release"),("$debug_images", "debug images"),("$issue_name", "issue name"),("$issue_description", "issue description"),