Repository navigation
fix(capture-exception): keep the stack trace in fatal exception payloads - #124
Merged
Merged
Conversation
A separate fatal/crash payload serializer must emit the same SDK-owned exception data as the handled path: an optional field with no value is omitted on the wire, not a reason to drop the frame, the stacktrace, or the $exception_list entry. Co-Authored-By: Claude Opus 5 <[email protected]> Generated-By: PostHog Desktop Task-Id: 6906e191-b1ef-46ca-a159-8620f4ba9e66
…llow dropping an oversized stacktrace Matches react-native boundedObject, which drops a stacktrace that alone exceeds the budget. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
turnipdabeets
marked this pull request as ready for review
October 20, 2026 19:47
marandaneto
reviewed
Oct 21, 2026
marandaneto
left a comment
Member
There was a problem hiding this comment.
Automated advisory code review.
…al parity Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
marandaneto
approved these changes
Oct 21, 2026
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.
Why
A fatal crash in
posthog-react-nativereached PostHog with no stack trace, while the same error captured as handled kept its stack (posthog-js#5287). Thecapture-exceptionspec requires a genuine stack trace to be preserved, but it only describes the handled path — it says nothing about the second, stricter serializer an SDK uses for a fatal/crash payload, so nothing forbade that path from silently emitting less for the same exception.Source change
main). The react-native fatal payload builder treated an object member with no value as making the whole object unserializable. Stack frames routinely carry one (chunk_idis unset for any frame whose file is not in the chunk-id map), so a single frame dropped the entirestacktraceand the crash was sent with onlytype,valueandmechanism. The fix makes the check match ordinary JSON serialization, which omits an absent member.What changed in the spec
New
capture-exceptionrequirement Fatal exception payloads keep their exception data (proposed, applied and archived on this branch per AGENTS.md):$exception_listentry with itsstacktraceand frames.stacktrace, or the entry.chunk_idis called out as the common case.$exception_listSHOULD be budgeted separately from caller-supplied custom properties; truncating within the exception data stays allowed.Scenarios use the prose style of the neighbouring "Ignored exception types" requirement, so no new harness steps are needed.
openspec validate --specs --stricttotals are unchanged frommain(the remaining warnings are the pre-existing long-requirement ones).Uncertain / worth a look
metricscapability onmain— the spec is still open in Add metrics capability spec #30, with docs: add network timing to metrics spec #66 stacked on it — so there is no home for this yet.v1branch (per-eventoptions, global/context option layers, personless as an event option, AI lane on the async client). It reshapes capture's option/property layering for server SDKs and needs a deliberate call, not an inferred spec edit.Created with PostHog Desktop
🤖 Generated with Claude Code