: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
fix(cli): accept camel-case chunk IDs (#87519)
Manoel Aranda Neto5e488e120131
diff --git a/cli/.sampo/changesets/camel-case-chunk-id.md b/cli/.sampo/changesets/camel-case-chunk-id.mdnew file mode 100644index 000000000000..0dced62f8053--- /dev/null+++ b/cli/.sampo/changesets/camel-case-chunk-id.md@@ -0,0 +1,5 @@+---+cargo/posthog-cli: patch+---++Accept sourcemaps that use the camel-case `chunkId` field when cloning or uploading Hermes sourcemaps.diff --git a/cli/src/sourcemaps/content.rs b/cli/src/sourcemaps/content.rsindex deff57ad35da..b6ca3e773a29 100644--- a/cli/src/sourcemaps/content.rs+++ b/cli/src/sourcemaps/content.rs@@ -80,7 +80,7 @@ pub fn get_injected_release_id(source: &str, chunk_id: &str) -> Option<String> {pub struct SourceMapContent {#[serde(skip_serializing_if = "Option::is_none")]pub release_id: Option<String>,- #[serde(skip_serializing_if = "Option::is_none")]+ #[serde(alias = "chunkId", skip_serializing_if = "Option::is_none")]pub chunk_id: Option<String>,/// Bundler-emitted ECMA-426 debug id. Kept separate from `chunk_id` so a bundler-stamped/// map isn't mistaken for one we already processed (which would skip the mapping@@ -792,6 +792,26 @@ mod tests {assert_eq!(upload.chunk_id, "11111111-2222-4333-8444-555555555555");}+ #[test]+ fn hermes_upload_accepts_map_with_camel_case_chunk_id() {+ let file = SourceMapFile {+ inner: SourceFile::new(+ PathBuf::from("bundle.js.map"),+ content_from(json!({+ "version": 3,+ "mappings": "AAAA",+ "sources": ["a.ts"],+ "names": [],+ "chunkId": "11111111-2222-4333-8444-555555555555",+ "x_hermes_function_offsets": {},+ })),+ ),+ };++ let upload: SymbolSetUpload = file.try_into().expect("Failed to convert to upload");+ assert_eq!(upload.chunk_id, "11111111-2222-4333-8444-555555555555");+ }+#[test]fn remove_sourcemap_reference_strips_standard_comment() {let mut source = minified_source("console.log(1);\n//# sourceMappingURL=chunk.js.map\n");