Skip to content

Commit

Permalink
Always send a default release (#695)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyrrrz authored Dec 28, 2020
1 parent 678c97b commit 0847ae3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- Add support for attachments. (#670) @Tyrrrz
- Improve logging for relay errors. (#683) @Tyrrrz
- Report sentry.dotnet.aspnet on the new Sentry.AspNet package. (#681) @Tyrrrz
- Always send a default release. (#695) @Tyrrrz

## 3.0.0-alpha.7

Expand Down
17 changes: 8 additions & 9 deletions src/Sentry/Internal/ApplicationVersionLocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@ internal static class ApplicationVersionLocator
return null;
}

var version = asm.GetNameAndVersion().Version;
var nameAndVersion = asm.GetNameAndVersion();

return !string.IsNullOrEmpty(version)
// If it really was on of the following, app would need to be set explicitly since these are defaults.
&& version != "0.0.0"
&& version != "1.0.0"
&& version != "0.0.0.0"
&& version != "1.0.0.0"
? $"{asm.GetName().Name}@{version}"
: null;
if (string.IsNullOrWhiteSpace(nameAndVersion.Name) ||
string.IsNullOrWhiteSpace(nameAndVersion.Version))
{
return null;
}

return $"{nameAndVersion.Name}@{nameAndVersion.Version}";
}
}
}
4 changes: 0 additions & 4 deletions test/Sentry.Tests/Internals/ApplicationVersionLocatorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ public void GetCurrent_ValidVersion_ReturnsVersion(string expectedVersion)

[Theory]
[InlineData("")]
[InlineData("0.0.0")]
[InlineData("1.0.0")]
[InlineData("0.0.0.0")]
[InlineData("1.0.0.0")]
public void GetCurrent_InvalidCases_ReturnsNull(string version)
{
var asm = AssemblyCreationHelper.CreateWithInformationalVersion(version);
Expand Down

0 comments on commit 0847ae3

Please sign in to comment.