File tree Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ Revision history for Sentry-SDK
33
44{{$NEXT}}
55
6+ - Fixed app detection.
7+
681.3.7 2024-11-18 15:54:49 CET
79
810 - Fixed app detection.
Original file line number Diff line number Diff line change @@ -12,10 +12,10 @@ has _source_file_registry => sub { Sentry::SourceFileRegistry->new };
1212has _home => sub { Mojo::Home-> new-> detect };
1313
1414sub _is_in_app ($self ) {
15- return
16- $self -> filename !~ / \. cpan\/ /
17- && index ($self -> filename, $Config {siteprefix }) == -1
18- && index ($self -> filename, $self -> _home) > -1;
15+ return substr ( $self -> filename, 0, 1) ne ' / '
16+ || ( $self -> filename !~ / \. cpan\/ /
17+ && index ($self -> filename, $Config {siteprefix }) == -1
18+ && index ($self -> filename, $self -> _home) > -1) ;
1919}
2020
2121sub _map_file_to_context ($self ) {
Original file line number Diff line number Diff line change @@ -44,6 +44,12 @@ describe 'Sentry::Stacktrace::Frame' => sub {
4444 ok !$frame_json -> {in_app };
4545 };
4646
47+ it ' correctly identifies local frames as in-app' => sub {
48+ $frame -> filename(' lib/My/Module.pm' );
49+ $frame_json = Mojo::JSON::decode_json Mojo::JSON::encode_json $frame ;
50+ ok $frame_json -> {in_app };
51+ };
52+
4753 it ' has file context' => sub {
4854 is $frame_json -> {pre_context }, ' pre context' ;
4955 is $frame_json -> {context_line }, ' context line' ;
You can’t perform that action at this time.
0 commit comments