Skip to content

Commit

Permalink
Merge pull request #1946 from bugsnag/master
Browse files Browse the repository at this point in the history
Sync next for v6.0.0
  • Loading branch information
lemnik authored Nov 20, 2023
2 parents 005ccd0 + dc934b8 commit c578699
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 24 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Changelog

## TBD
## 6.0.0 (2023-11-20)

### Breaking Changes

- (breaking API change) Redacted Keys and Discard Classes are now matched as a `Pattern` instead of `String`
- (breaking API change) Removed `ThreadType` in favour of `ErrorType` bringing bugsnag-android inline with other platform SDKs
- (breaking API change) Removed the deprecated `Configuration.launchCrashThresholdMs` accessors and manifest entry (which was previously replaced by `Configuration.launchDurationMillis`)
- (breaking API change) `Thread.id` is now a `String` instead of an `int`
- (breaking API change) The legacy `bugsnag-android-ndk` module has been removed in favor of `bugsnag-plugin-android-ndk`
- (behaviour change) API Key validation has moved to `Bugsnag.start` (instead of when the `Configuration` is created), this means that `Bugsnag.start` will now fail with an exception if no API key is provided
- (behaviour change) When no `BUILD_UUID` is specified one is automatically derived from your `.dex` files in order to match your bytecode to the appropriate `mapping.txt` file exactly.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import java.io.IOException
*/
class Notifier @JvmOverloads constructor(
var name: String = "Android Bugsnag Notifier",
var version: String = "5.31.3",
var version: String = "6.0.0",
var url: String = "https://bugsnag.com"
) : JsonStream.Streamable {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ internal object ForegroundDetector : ActivityLifecycleCallbacks, Handler.Callbac
mainThreadHandler.sendMessageDelayed(backgroundMessage, BACKGROUND_TIMEOUT_MS)
} else {
notifyListeners { it.onForegroundStatus(false, stoppedTimestamp) }
isInForeground = false
lastExitedForegroundMs = stoppedTimestamp
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public void serialize(Map<String, Object> map, ImmutableConfig config) {
map.put("autoDetectErrors", config.getAutoDetectErrors());
map.put("autoTrackSessions", config.getAutoTrackSessions());
map.put("sendThreads", config.getSendThreads().toString());
map.put("discardClasses", config.getDiscardClasses());
map.put("projectPackages", config.getProjectPackages());
map.put("enabledReleaseStages", config.getEnabledReleaseStages());
map.put("releaseStage", config.getReleaseStage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ public void serialize() {
assertTrue((Boolean) map.get("autoTrackSessions"));
assertEquals("ALWAYS", map.get("sendThreads"));

Matcher matcher = Pattern.compile("com.example.DiscardClass", Pattern.LITERAL)
.matcher(map.get("discardClasses").toString());
assertTrue(matcher.find());

assertEquals(Collections.singleton("production"), map.get("enabledReleaseStages"));
assertEquals(Collections.singleton("com.example"), map.get("projectPackages"));
assertEquals("production", map.get("releaseStage"));
Expand Down
6 changes: 3 additions & 3 deletions dockerfiles/Dockerfile.android-publisher
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ COPY buildSrc/ buildSrc/

# Copy sdk source files
COPY bugsnag-android/ bugsnag-android/
COPY bugsnag-android-ndk/ bugsnag-android-ndk/
COPY bugsnag-plugin-android-anr/ bugsnag-plugin-android-anr/
COPY bugsnag-android-core/ bugsnag-android-core/
COPY bugsnag-plugin-android-anr/ bugsnag-plugin-android-anr/
COPY bugsnag-plugin-android-exitinfo/ bugsnag-plugin-android-exitinfo/
COPY bugsnag-plugin-android-ndk/ bugsnag-plugin-android-ndk/
COPY bugsnag-plugin-react-native/ bugsnag-plugin-react-native/
COPY bugsnag-plugin-android-okhttp/ bugsnag-plugin-android-okhttp/
COPY bugsnag-plugin-react-native/ bugsnag-plugin-react-native/
COPY scripts/ scripts/
COPY config/ config/
COPY LICENSE LICENSE
Expand Down
4 changes: 2 additions & 2 deletions examples/sdk-app-example/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ android {
}

dependencies {
implementation "com.bugsnag:bugsnag-android:5.31.3"
implementation "com.bugsnag:bugsnag-plugin-android-okhttp:5.31.3"
implementation "com.bugsnag:bugsnag-android:6.0.0"
implementation "com.bugsnag:bugsnag-plugin-android-okhttp:6.0.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "androidx.appcompat:appcompat:1.4.0"
implementation "com.google.android.material:material:1.4.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,20 @@ internal class InForegroundScenario(
) : Scenario(config, context, eventMetadata) {

private var triggered = AtomicBoolean(false)
private val mainHandler = Handler(Looper.getMainLooper())

override fun startScenario() {
super.startScenario()
registerActivityLifecycleCallbacks()

// make sure the app goes to the background
mainHandler.post {
(context as Activity).finish()
}
}

override fun onActivityStopped(activity: Activity) {
Handler(Looper.getMainLooper()).post {
mainHandler.post {
// debounce so this can only ever occur once
if (!triggered.getAndSet(true)) {
log("onActivityStopped is finished, calling Bugsnag.notify in the background")
Expand Down
3 changes: 0 additions & 3 deletions features/full_tests/in_foreground.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ Feature: In foreground field populates correctly
Background:
Given I clear all persistent data

# TODO: Skipped pending PLAT-10634
@skip
Scenario: Test handled exception in background
When I run "InForegroundScenario"
And I send the app to the background for 5 seconds
Then I wait to receive an error
And the error is valid for the error reporting API version "4.0" for the "Android Bugsnag Notifier" notifier
# PLAT-9155 Flaky: the event "app.inForeground" is false
Expand Down
7 changes: 0 additions & 7 deletions features/full_tests/strict_mode_legacy.feature
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,3 @@ Feature: Reporting Strict Mode Violations
And the exception "errorClass" equals "android.os.StrictMode$StrictModeViolation"
And the event "metaData.StrictMode.Violation" equals "NetworkOperation"
And the event "severityReason.type" equals "strictMode"

# In Android <9 StrictMode kills VM policy violations with SIGKILL, so no requests are received.
@skip_above_android_8
Scenario: StrictMode Activity leak violation
When I run "StrictModeFileUriExposeScenario" and relaunch the crashed app
And I configure Bugsnag for "StrictModeFileUriExposeScenario"
Then Bugsnag confirms it has no errors to send
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ org.gradle.jvmargs=-Xmx4096m
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
org.gradle.parallel=true
VERSION_NAME=5.31.3
VERSION_NAME=6.0.0
GROUP=com.bugsnag
POM_SCM_URL=https://github.com/bugsnag/bugsnag-android
POM_SCM_CONNECTION=scm:[email protected]:bugsnag/bugsnag-android.git
Expand Down

0 comments on commit c578699

Please sign in to comment.