Skip to content

: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.

feat(cymbal): set posthog-android and posthog-server wire-order cutoffs (#72350)

Catalin Irimie19e439bdfc80
diff --git a/rust/cymbal/src/modes/processing/normalization.rs b/rust/cymbal/src/modes/processing/normalization.rs
index 85134985c788..4082109ebf27 100644
--- a/rust/cymbal/src/modes/processing/normalization.rs
+++ b/rust/cymbal/src/modes/processing/normalization.rs
@@ -102,6 +102,13 @@ fn lib_rules() -> &'static [LibRule] {
"posthog-php" => Some(Version::new(4, 11, 0)),
// posthog-go ships the flip in 1.20.0 (PostHog/posthog-go#254).
"posthog-go" => Some(Version::new(1, 20, 0)),
+ // android + the java server SDK flip together (shared
+ // coercer, one release train: PostHog/posthog-android#603),
+ // but each module reports its own version stream.
+ "posthog-android" => Some(Version::new(3, 56, 0)),
+ "posthog-server" => Some(Version::new(2, 9, 0)),
+ // `posthog-java` is the tombstoned legacy SDK: it will
+ // never ship the flip, so no cutoff, ever.
_ => None,
},
})
@@ -319,6 +326,43 @@ mod test {
assert!(legacy_wire_order(None, &canonical).is_none());
}
+ #[test]
+ fn android_and_server_cutoffs_gate_normalization_by_version() {
+ // Both modules flip in one release train but carry separate version
+ // streams; each gate keys on its own module's version.
+ for (lib, below, at) in [
+ ("posthog-android", "3.55.2", "3.56.0"),
+ ("posthog-server", "2.8.1", "2.9.0"),
+ ] {
+ for version in [Some(below), Some("1.0.0"), Some("garbage"), None] {
+ let mut list: ExceptionList =
+ vec![exception_with_frames("Boom", &["main", "boom"])].into();
+ let legacy = normalize_wire_order(&mut list, Some(lib), version);
+ assert!(legacy.is_some(), "{lib} {version:?} should normalize");
+ assert_eq!(frame_names(&list[0]), vec!["boom", "main"]);
+ }
+
+ let mut list: ExceptionList =
+ vec![exception_with_frames("Boom", &["main", "boom"])].into();
+ let legacy = normalize_wire_order(&mut list, Some(lib), Some(at));
+ assert!(legacy.is_none(), "{lib} {at} 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(lib), &canonical)
+ .expect("reconstruction must ignore the cutoff");
+ assert_eq!(frame_names(&legacy[0]), vec!["boom", "main"]);
+ }
+
+ // The tombstoned java SDK keeps normalizing at any version.
+ let mut list: ExceptionList = vec![exception_with_frames("Boom", &["main", "boom"])].into();
+ let legacy = normalize_wire_order(&mut list, Some("posthog-java"), Some("99.0.0"));
+ assert!(legacy.is_some(), "posthog-java has no cutoff");
+ assert_eq!(frame_names(&list[0]), vec!["boom", "main"]);
+ }
+
#[test]
fn go_cutoff_gates_normalization_by_version() {
// Below the 1.20.0 cutoff (and unparseable versions): crash-first on