feat: send error tracking stack frames in canonical bottom-up order#603
Draft
cat-ph wants to merge 1 commit into
Draft
feat: send error tracking stack frames in canonical bottom-up order#603cat-ph wants to merge 1 commit into
cat-ph wants to merge 1 commit into
Conversation
|
Reviews (1): Last reviewed commit: "feat: send error tracking stack frames i..." | Re-trigger Greptile |
Contributor
posthog-android Compliance ReportDate: 2026-07-03 00:13:26 UTC ✅ All Tests Passed!46/46 tests passed Capture Tests✅ 29/29 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 Motivation and Context
Part of cross-SDK error tracking standardization: PostHog/sdk-specs#11.
The canonical wire order for
$exception_list[].stacktrace.framesis bottom-up:frames[0]is the outermost/entry point and the last frame is the crash site. Today the shared exception coercer emits Java's native innermost-first order (crash site first), which is the opposite of the canonical convention.This PR flips the frame order to match the spec.
🔧 The change
ThrowableCoercer.fromThrowableToPostHogPropertiesnow walksthrowable.stackTracein reverse when building theframeslist, so the emitted order is entry-point-first / crash-site-last.The
$exception_listordering itself is unchanged (already canonical:[0]= outermost exception, built by walking.cause). Only the per-exception frame order flips.Because this coercer is shared, the change covers both shipped
$libs:posthog-android(Android SDK)posthog-server(Java server SDK)💚 How did you test it?
posthog/src/test/java/com/posthog/PostHogTest.kt.stackTrace— first frame = entry point, last frame = crash site, and the crash-site (last) frame is the in-app method that threw../gradlew spotlessCheck :posthog:testpasses (748 tests).🤝 Coordination
This is a BREAKING wire-order change. Merge and release only after the ingestion pipeline's frame-order normalization gate (cymbal) is live, so older-order and newer-order events are both normalized correctly server-side.
The release must be a MINOR version bump for both
posthog-androidandposthog-serverso the pipeline can gate normalization on$lib_version. The changeset in this PR declares minor bumps forposthog,posthog-android, andposthog-server.📝 Checklist
.changeset/canonical-frame-order.md, minor bumps).