Skip to content

Commit b2a0c05

Browse files
authored
Merge 3d41a98 into 2dc8f22
2 parents 2dc8f22 + 3d41a98 commit b2a0c05

File tree

9 files changed

+551
-486
lines changed

9 files changed

+551
-486
lines changed

CHANGELOG.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,19 @@
2424

2525
### Dependencies
2626

27-
- Bump CLI from v2.39.1 to v2.40.0 ([#4412](https://github.com/getsentry/sentry-react-native/pull/4412))
28-
- [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2400)
29-
- [diff](https://github.com/getsentry/sentry-cli/compare/2.39.1...2.40.0)
27+
- Bump CLI from v2.39.1 to v2.41.0 ([#4412](https://github.com/getsentry/sentry-react-native/pull/4412), [#4468](https://github.com/getsentry/sentry-react-native/pull/4468))
28+
- [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2410)
29+
- [diff](https://github.com/getsentry/sentry-cli/compare/2.39.1...2.41.0)
3030
- Bump JavaScript SDK from v8.47.0 to v8.50.0 ([#4421](https://github.com/getsentry/sentry-react-native/pull/4421), [#4449](https://github.com/getsentry/sentry-react-native/pull/4449), [#4453](https://github.com/getsentry/sentry-react-native/pull/4453))
3131
- [changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#8500)
3232
- [diff](https://github.com/getsentry/sentry-javascript/compare/8.47.0...8.50.0)
33+
- Bump Android SDK from v7.20.0 to v7.20.1 ([#4467](https://github.com/getsentry/sentry-react-native/pull/4467))
34+
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#7201)
35+
- [diff](https://github.com/getsentry/sentry-java/compare/7.20.0...7.20.1)
36+
37+
### Internal
38+
39+
- Extract Android native initialization to standalone structures ([#4445](https://github.com/getsentry/sentry-react-native/pull/4445))
3340

3441
## 6.5.0
3542

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"devDependencies": {
3131
"@expo/swiftlint": "^0.57.1",
3232
"@naturalcycles/ktlint": "^1.13.0",
33-
"@sentry/cli": "2.40.0",
33+
"@sentry/cli": "2.41.0",
3434
"clang-format": "^1.8.0",
3535
"downlevel-dts": "^0.11.0",
3636
"google-java-format": "^1.4.0",

packages/core/RNSentryAndroidTester/app/src/test/java/io/sentry/react/RNSentryModuleImplTest.kt

Lines changed: 0 additions & 166 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,13 @@ package io.sentry.react
33
import android.content.pm.PackageInfo
44
import android.content.pm.PackageManager
55
import com.facebook.react.bridge.Arguments
6-
import com.facebook.react.bridge.JavaOnlyMap
76
import com.facebook.react.bridge.Promise
87
import com.facebook.react.bridge.ReactApplicationContext
98
import com.facebook.react.bridge.WritableMap
10-
import com.facebook.react.common.JavascriptException
11-
import io.sentry.Breadcrumb
129
import io.sentry.ILogger
1310
import io.sentry.SentryLevel
14-
import io.sentry.android.core.SentryAndroidOptions
1511
import org.junit.After
1612
import org.junit.Assert.assertEquals
17-
import org.junit.Assert.assertFalse
18-
import org.junit.Assert.assertNull
19-
import org.junit.Assert.assertTrue
2013
import org.junit.Before
2114
import org.junit.Test
2215
import org.junit.runner.RunWith
@@ -103,163 +96,4 @@ class RNSentryModuleImplTest {
10396
val capturedMap = writableMapCaptor.value
10497
assertEquals(false, capturedMap.getBoolean("has_fetched"))
10598
}
106-
107-
@Test
108-
fun `when the spotlight option is enabled, the spotlight SentryAndroidOption is set to true and the default url is used`() {
109-
val options =
110-
JavaOnlyMap.of(
111-
"spotlight",
112-
true,
113-
"defaultSidecarUrl",
114-
"http://localhost:8969/teststream",
115-
)
116-
val actualOptions = SentryAndroidOptions()
117-
module.getSentryAndroidOptions(actualOptions, options, logger)
118-
assert(actualOptions.isEnableSpotlight)
119-
assertEquals("http://localhost:8969/teststream", actualOptions.spotlightConnectionUrl)
120-
}
121-
122-
@Test
123-
fun `when the spotlight url is passed, the spotlight is enabled for the given url`() {
124-
val options = JavaOnlyMap.of("spotlight", "http://localhost:8969/teststream")
125-
val actualOptions = SentryAndroidOptions()
126-
module.getSentryAndroidOptions(actualOptions, options, logger)
127-
assert(actualOptions.isEnableSpotlight)
128-
assertEquals("http://localhost:8969/teststream", actualOptions.spotlightConnectionUrl)
129-
}
130-
131-
@Test
132-
fun `when the spotlight option is disabled, the spotlight SentryAndroidOption is set to false`() {
133-
val options = JavaOnlyMap.of("spotlight", false)
134-
val actualOptions = SentryAndroidOptions()
135-
module.getSentryAndroidOptions(actualOptions, options, logger)
136-
assertFalse(actualOptions.isEnableSpotlight)
137-
}
138-
139-
@Test
140-
fun `the JavascriptException is added to the ignoredExceptionsForType list on initialisation`() {
141-
val actualOptions = SentryAndroidOptions()
142-
module.getSentryAndroidOptions(actualOptions, JavaOnlyMap.of(), logger)
143-
assertTrue(actualOptions.ignoredExceptionsForType.contains(JavascriptException::class.java))
144-
}
145-
146-
@Test
147-
fun `beforeBreadcrumb callback filters out Sentry DSN requests breadcrumbs`() {
148-
val options = SentryAndroidOptions()
149-
val rnOptions =
150-
JavaOnlyMap.of(
151-
"dsn",
152-
"https://[email protected]/1234567",
153-
"devServerUrl",
154-
"http://localhost:8081",
155-
)
156-
module.getSentryAndroidOptions(options, rnOptions, logger)
157-
158-
val breadcrumb =
159-
Breadcrumb().apply {
160-
type = "http"
161-
setData("url", "https://def.ingest.sentry.io/1234567")
162-
}
163-
164-
val result = options.beforeBreadcrumb?.execute(breadcrumb, mock())
165-
166-
assertNull("Breadcrumb should be filtered out", result)
167-
}
168-
169-
@Test
170-
fun `beforeBreadcrumb callback filters out dev server breadcrumbs`() {
171-
val mockDevServerUrl = "http://localhost:8081"
172-
val options = SentryAndroidOptions()
173-
val rnOptions =
174-
JavaOnlyMap.of(
175-
"dsn",
176-
"https://[email protected]/1234567",
177-
"devServerUrl",
178-
mockDevServerUrl,
179-
)
180-
module.getSentryAndroidOptions(options, rnOptions, logger)
181-
182-
val breadcrumb =
183-
Breadcrumb().apply {
184-
type = "http"
185-
setData("url", mockDevServerUrl)
186-
}
187-
188-
val result = options.beforeBreadcrumb?.execute(breadcrumb, mock())
189-
190-
assertNull("Breadcrumb should be filtered out", result)
191-
}
192-
193-
@Test
194-
fun `beforeBreadcrumb callback does not filter out non dev server or dsn breadcrumbs`() {
195-
val options = SentryAndroidOptions()
196-
val rnOptions =
197-
JavaOnlyMap.of(
198-
"dsn",
199-
"https://[email protected]/1234567",
200-
"devServerUrl",
201-
"http://localhost:8081",
202-
)
203-
module.getSentryAndroidOptions(options, rnOptions, logger)
204-
205-
val breadcrumb =
206-
Breadcrumb().apply {
207-
type = "http"
208-
setData("url", "http://testurl.com/service")
209-
}
210-
211-
val result = options.beforeBreadcrumb?.execute(breadcrumb, mock())
212-
213-
assertEquals(breadcrumb, result)
214-
}
215-
216-
@Test
217-
fun `the breadcrumb is not filtered out when the dev server url and dsn are not passed`() {
218-
val options = SentryAndroidOptions()
219-
module.getSentryAndroidOptions(options, JavaOnlyMap(), logger)
220-
221-
val breadcrumb =
222-
Breadcrumb().apply {
223-
type = "http"
224-
setData("url", "http://testurl.com/service")
225-
}
226-
227-
val result = options.beforeBreadcrumb?.execute(breadcrumb, mock())
228-
229-
assertEquals(breadcrumb, result)
230-
}
231-
232-
@Test
233-
fun `the breadcrumb is not filtered out when the dev server url is not passed and the dsn does not match`() {
234-
val options = SentryAndroidOptions()
235-
val rnOptions = JavaOnlyMap.of("dsn", "https://[email protected]/1234567")
236-
module.getSentryAndroidOptions(options, rnOptions, logger)
237-
238-
val breadcrumb =
239-
Breadcrumb().apply {
240-
type = "http"
241-
setData("url", "http://testurl.com/service")
242-
}
243-
244-
val result = options.beforeBreadcrumb?.execute(breadcrumb, mock())
245-
246-
assertEquals(breadcrumb, result)
247-
}
248-
249-
@Test
250-
fun `the breadcrumb is not filtered out when the dev server url does not match and the dsn is not passed`() {
251-
val options = SentryAndroidOptions()
252-
val rnOptions = JavaOnlyMap.of("devServerUrl", "http://localhost:8081")
253-
module.getSentryAndroidOptions(options, rnOptions, logger)
254-
255-
val breadcrumb =
256-
Breadcrumb().apply {
257-
type = "http"
258-
setData("url", "http://testurl.com/service")
259-
}
260-
261-
val result = options.beforeBreadcrumb?.execute(breadcrumb, mock())
262-
263-
assertEquals(breadcrumb, result)
264-
}
26599
}

0 commit comments

Comments
 (0)