Skip to content

Commit

Permalink
fix: Invert in_app detection (getsentry#715)
Browse files Browse the repository at this point in the history
  • Loading branch information
HazAT authored and Jean85 committed Nov 28, 2018
1 parent 44727e7 commit cd109c0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Frame.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ final class Frame implements \JsonSerializable
* @var bool Flag telling whether the frame is related to the execution of
* the relevant code in this stacktrace
*/
private $inApp = false;
private $inApp = true;

/**
* @var array A mapping of variables which were available within this
Expand Down
2 changes: 1 addition & 1 deletion src/Stacktrace.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public function addFrame(string $file, int $line, array $backtraceFrame): void
if ($isApplicationFile && !empty($excludedAppPaths)) {
foreach ($excludedAppPaths as $path) {
if (0 === strpos($absoluteFilePath, $path)) {
$frame->setIsInApp($isApplicationFile);
$frame->setIsInApp(false);

break;
}
Expand Down
6 changes: 3 additions & 3 deletions tests/StacktraceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ public function testAddFrameMarksAsInApp(): void

$frames = $stacktrace->getFrames();

$this->assertTrue($frames[0]->isInApp());
$this->assertFalse($frames[1]->isInApp());
$this->assertFalse($frames[0]->isInApp());
$this->assertTrue($frames[1]->isInApp());
}

public function testAddFrameReadsCodeFromShortFile(): void
Expand Down Expand Up @@ -262,7 +262,7 @@ public function testInAppWithEmptyFrame(): void

$this->assertCount(1, $frames);
$this->assertContainsOnlyInstancesOf(Frame::class, $frames);
$this->assertFalse($frames[0]->isInApp());
$this->assertTrue($frames[0]->isInApp());
}

public function testGetFrameArgumentsDoesNotModifyCapturedArgs(): void
Expand Down

0 comments on commit cd109c0

Please sign in to comment.