-
-
Notifications
You must be signed in to change notification settings - Fork 53
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: allow optional abs_path and lineno for JsFrame #1581
base: master
Are you sure you want to change the base?
fix: allow optional abs_path and lineno for JsFrame #1581
Conversation
829c938
to
13cc9d3
Compare
13cc9d3
to
2b799fe
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1581 +/- ##
==========================================
- Coverage 76.09% 73.57% -2.52%
==========================================
Files 101 105 +4
Lines 15262 15903 +641
==========================================
+ Hits 11613 11700 +87
- Misses 3649 4203 +554 |
Co-authored-by: David Herberth <[email protected]>
Co-authored-by: David Herberth <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just left some small Rust nits, otherwise looks good to me, but I want to wait on @loewenheim for a review, since I can't really judge the implications of the change fully.
Also would be great if you can add a test, I think symbolicator-js/tests/integration/sourcemap.rs
should be the right place and pretty low effort to add.
@@ -154,7 +162,7 @@ async fn symbolicate_js_frame( | |||
.map(|entry| entry.sourcemap_url()) | |||
.ok() | |||
.flatten() | |||
.unwrap_or_else(|| raw_frame.abs_path.clone()); | |||
.unwrap_or_else(|| raw_frame.abs_path.clone().unwrap_or_default()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can use abs_path.to_owned()
here now, I think, since we already checked for Some
before.
.unwrap_or_else(|| raw_frame.abs_path.clone().unwrap_or_default()); | |
.unwrap_or_else(|| abs_path.to_owned()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to revert this in 12d1d5e to fix a compilation error
error[E0502]: cannot borrow `*raw_frame` as mutable because it is also borrowed as immutable
--> crates/symbolicator-js/src/symbolication.rs:145:17
|
105 | ...ath = raw_frame
| __________-
106 | | ...path
| |_______- immutable borrow occurs here
...
145 | ... apply_source_context(raw_frame, minified_source.contents(...
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here
...
163 | ...ap_or_else(|| abs_path.to_owned());
| -------- immutable borrow later captured here by closure
Co-authored-by: David Herberth <[email protected]>
Co-authored-by: David Herberth <[email protected]>
Co-authored-by: David Herberth <[email protected]>
fixes #1580
It's possible for V8 to format a JS frame location to only contain
<anonymous>
(see AppendFileLocation). In such cases, JSON deserialization should pass, but symbolification should fail.Here's an example call stack this addresses:
Also, this is the first Rust code I've written so please lmk what can be improved!