Skip to content

Commit

Permalink
fix: prevent duplicate notifier dependencies being added
Browse files Browse the repository at this point in the history
  • Loading branch information
fractalwrench committed Jul 23, 2020
1 parent 1c2594f commit 40cac49
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

The following alterations have been made to support the React Native notifier:

* Prevent duplicate notifier dependencies being added
[#911](https://github.com/bugsnag/bugsnag-android/pull/911)

* Respect pre-populated fields on `Event` when notifying
[#906](https://github.com/bugsnag/bugsnag-android/pull/906)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Notifier @JvmOverloads constructor(
var url: String = "https://bugsnag.com"
) : JsonStream.Streamable {

val dependencies = mutableListOf<Notifier>()
var dependencies = listOf<Notifier>()

@Throws(IOException::class)
override fun toStream(writer: JsonStream) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ internal class NotifierSerializationTest {
deps.version = "4.5.6"
deps.name = "CustomNotifier"
deps.url = "https://example.com"
deps.dependencies.add(notifier)
deps.dependencies = listOf(notifier)
return generateSerializationTestCases("notifier", notifier, deps)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class BugsnagReactNativePlugin : Plugin {
notifier.name = "Bugsnag React Native"
notifier.url = "https://github.com/bugsnag/bugsnag-js"
notifier.version = jsVersion
notifier.dependencies.add(Notifier()) // depend on bugsnag-android
client.notifier.dependencies = listOf(Notifier()) // depend on bugsnag-android
}

private fun ignoreJavaScriptExceptions() {
Expand Down

0 comments on commit 40cac49

Please sign in to comment.