: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
feat(cymbal): set posthog-php wire-order cutoff at 4.11.0 (#70879)
Catalin Irimie725a25f60fb9
diff --git a/rust/cymbal/src/modes/processing/normalization.rs b/rust/cymbal/src/modes/processing/normalization.rsindex 70c43c7594f1..7fbabf116176 100644--- a/rust/cymbal/src/modes/processing/normalization.rs+++ b/rust/cymbal/src/modes/processing/normalization.rs@@ -98,6 +98,8 @@ fn lib_rules() -> &'static [LibRule] {canonical_since: match lib {// posthog-rs ships the flip in 0.19.0 (PostHog/posthog-rs#176)."posthog-rs" => Some(Version::new(0, 19, 0)),+ // posthog-php ships the flip in 4.11.0 (PostHog/posthog-php#200).+ "posthog-php" => Some(Version::new(4, 11, 0)),_ => None,},})@@ -315,6 +317,35 @@ mod test {assert!(legacy_wire_order(None, &canonical).is_none());}+ #[test]+ fn php_cutoff_gates_normalization_by_version() {+ // Below the 4.11.0 cutoff (and unparseable versions): crash-first on+ // the wire, frames reverse, legacy snapshot returned.+ for version in [Some("4.10.0"), Some("4.9.0"), Some("dev-main"), None] {+ let mut list: ExceptionList =+ vec![exception_with_frames("Boom", &["main", "boom"])].into();+ let legacy = normalize_wire_order(&mut list, Some("posthog-php"), version);+ assert!(legacy.is_some(), "{version:?} should normalize");+ assert_eq!(frame_names(&list[0]), vec!["boom", "main"]);+ }++ // At/above the cutoff: canonical on the wire, untouched.+ for version in ["4.11.0", "4.11.1", "4.12.0", "5.0.0"] {+ let mut list: ExceptionList =+ vec![exception_with_frames("Boom", &["main", "boom"])].into();+ let legacy = normalize_wire_order(&mut list, Some("posthog-php"), Some(version));+ assert!(legacy.is_none(), "{version} should pass through");+ assert_eq!(frame_names(&list[0]), vec!["main", "boom"]);+ }++ // Legacy hashing still reconstructs pre-flip order post-cutoff.+ let canonical: ExceptionList =+ vec![exception_with_frames("Boom", &["main", "boom"])].into();+ let legacy = legacy_wire_order(Some("posthog-php"), &canonical)+ .expect("reconstruction must ignore the cutoff");+ assert_eq!(frame_names(&legacy[0]), vec!["boom", "main"]);+ }+#[test]fn rs_cutoff_gates_normalization_by_version() {// Below the 0.19.0 cutoff (and for unparseable versions): still