fix: match SDK capture frames across demangler renderings - #179
Merged
Conversation
cat-ph
marked this pull request as ready for review
July 10, 2026 16:33
turnipdabeets
approved these changes
Jul 10, 2026
Contributor
posthog-rs-v0 Compliance ReportDate: 2026-07-10 16:35:30 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
|
|
Reviews (1): Last reviewed commit: "fix: match SDK capture frames across dem..." | Re-trigger Greptile |
Contributor
posthog-rs-v1 Compliance ReportDate: 2026-07-10 16:36:14 UTC ✅ All Tests Passed!111/111 tests passed Capture_V1 Tests✅ 94/94 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.
Problem
CI on main went red after #176 merged:
from_error_builds_exception_list_with_stacktracefails on Linux withexpected user frame last, got "<posthog_rs::error_tracking::Exception>::from_error::<...>".Root cause is not the wire-order flip itself:
is_internal_capture_framematches SDK capture helpers by substring (e.g.Exception::from_error), but newer toolchain/demangler output renders qualified paths as<posthog_rs::error_tracking::Exception>::from_error::<T>— the closing>breaks the substring match, so the SDK frame survives the strip and sits at the crash-site end of the canonical order. The PR's own CI was green a week earlier under the older rendering, and macOS still renders bracket-free, which is why this only surfaced on the post-merge Linux run.Exception::from_messageandClient::capture_exceptionhad the same latent hole.Released 0.19.0 carries the bug: manual
from_error/capture_exceptioncaptures built under newer toolchains keep one SDK frame at the stack tail (consistent per error, so grouping is stable — but the tail frame is wrong and the fingerprint includes SDK noise).Changes
is_internal_capture_framestrips</>from the demangled name before matching, so both renderings (and monomorphized generic suffixes) hit all existing patterns. Panic/unwind runtime frames remain deliberately unmatched, as before.patchchangeset → 0.19.1. The cymbal wire-order cutoff is0.19.0, so the patch passes the gate as canonical, which is correct — it contains the flip.How did you test this code?
Automated only:
error_trackingtests pass there, including the previously failing one.cargo test --libon macOS (188 passed) — the older bracket-free rendering still matches.personal_api_keydeprecation warnings intest_on_error.rs(from feat: add secret_key config, deprecate personal_api_key #174) are untouched/out of scope.🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Claude Code diagnosed and fixed this under my direction: pulled the failing main run, reproduced in a Linux container to get the assertion text CI logs omitted, bisected the discrepancy to demangler rendering differences rather than the #176 logic, and validated on both renderings.