Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(err): assume anonymous frames aren't in-app #26496

Merged
merged 2 commits into from
Nov 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion rust/cymbal/src/langs/js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,23 @@ impl From<(&RawJSFrame, JsResolveErr, &FrameLocation)> for Frame {
impl From<&RawJSFrame> for Frame {
fn from(raw_frame: &RawJSFrame) -> Self {
metrics::counter!(FRAME_NOT_RESOLVED, "lang" => "javascript").increment(1);

// If this is a source_url: <anonymous> frame, we always assume it's not in_app
let is_anon = raw_frame
.source_url
.as_ref()
.map(|s| s == "<anonymous>")
.unwrap_or_default();

let in_app = raw_frame.in_app && !is_anon;
oliverb123 marked this conversation as resolved.
Show resolved Hide resolved

let mut res = Self {
raw_id: String::new(),
mangled_name: raw_frame.fn_name.clone(),
line: None,
column: None,
source: raw_frame.source_url().map(|u| u.path().to_string()).ok(),
in_app: raw_frame.in_app,
in_app,
resolved_name: Some(raw_frame.fn_name.clone()),
lang: "javascript".to_string(),
resolved: true, // Without location information, we're assuming this is not minified
Expand Down