Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
22029c1
lazy uuid generation for SentryId and SpanId
lbloder Oct 7, 2024
f947f82
add changelog
lbloder Oct 7, 2024
debd140
Merge branch '8.x.x' into feat/lazy-span-id-v8
adinauer Oct 9, 2024
e6df0ad
add tests for lazy init, rework SentryId to cache string result
lbloder Oct 11, 2024
8a93fec
Merge branch '8.x.x' into feat/lazy-span-id-v8
lbloder Oct 11, 2024
fe8ccb0
Merge branch '8.x.x' into feat/lazy-span-id-v8
lbloder Oct 15, 2024
28b5bde
Merge branch '8.x.x' into feat/lazy-span-id-v8
lbloder Oct 18, 2024
f2fba85
fix changelog
lbloder Oct 18, 2024
3e1a32c
Merge branch '8.x.x' into feat/lazy-span-id-v8
lbloder Oct 21, 2024
c7ab294
Update sentry/src/main/java/io/sentry/protocol/SentryId.java
lbloder Oct 22, 2024
f1e66b2
Update sentry/src/main/java/io/sentry/protocol/SentryId.java
lbloder Oct 22, 2024
76b23c8
Update sentry/src/main/java/io/sentry/protocol/SentryId.java
lbloder Oct 22, 2024
8599535
Update sentry/src/main/java/io/sentry/protocol/SentryId.java
lbloder Oct 22, 2024
3bae1d7
Update sentry/src/main/java/io/sentry/protocol/SentryId.java
lbloder Oct 22, 2024
edba0c7
Format code
getsentry-bot Oct 22, 2024
c18a74d
Add object comparison to SpanFrameMetricsCollector only check for tim…
lbloder Oct 22, 2024
35b17db
Merge branch 'feat/lazy-span-id-v8' of github.com:getsentry/sentry-ja…
lbloder Oct 22, 2024
a50d881
add proposed SentryUUID class
lbloder Oct 22, 2024
149d59c
[WIP] use SentryUUID instead of UUID.random().toString
lbloder Oct 22, 2024
6418a33
Format code
getsentry-bot Oct 23, 2024
5314e83
split SentryUUID internals into separate classes for easier attribution
lbloder Oct 29, 2024
58a00c4
Merge branch '8.x.x' into feat/lazy-span-id-v8
lbloder Oct 29, 2024
097738b
add changelog
lbloder Oct 29, 2024
3518fce
Merge branch 'feat/lazy-span-id-v8' into feat/fast-id-generation
lbloder Oct 29, 2024
4070536
replace uuid with string for sessionId, use SentryUUID for generating…
lbloder Oct 29, 2024
df743f2
add changelog
lbloder Oct 29, 2024
9803d5c
Format code
getsentry-bot Oct 29, 2024
d11c3cc
fix tests
lbloder Oct 29, 2024
1ea4212
Merge branch '8.x.x' into feat/fast-id-generation
lbloder Oct 29, 2024
81a3bdb
fix SpanId.EMPTY_ID
lbloder Oct 29, 2024
c15312f
Merge branch 'feat/fast-id-generation' into feat/session-id-as-string
adinauer Oct 30, 2024
5d00ae5
Merge branch '8.x.x' into feat/fast-id-generation
lbloder Nov 4, 2024
311c151
Merge branch 'feat/fast-id-generation' into feat/session-id-as-string
lbloder Nov 4, 2024
32097ad
fix tests
lbloder Nov 4, 2024
3adf03d
Format code
getsentry-bot Nov 4, 2024
9a1cf0e
move changelog entry to breaking changes section, add more detail
lbloder Nov 4, 2024
fac412e
test normalized is never called in no-arg constructor, only called on…
lbloder Nov 8, 2024
d015201
add log if invalid session id is being deserialized
lbloder Nov 8, 2024
9f360d1
Merge branch '8.x.x' into feat/fast-id-generation
lbloder Nov 8, 2024
7828b42
Merge branch 'feat/fast-id-generation' into feat/session-id-as-string
lbloder Nov 8, 2024
30b2602
fix test
lbloder Nov 8, 2024
fce5ac8
Merge branch 'feat/fast-id-generation' into feat/session-id-as-string
lbloder Nov 8, 2024
05540a3
Format code
getsentry-bot Nov 8, 2024
143c26e
use new Random Generator
lbloder Nov 8, 2024
57d0a9b
Merge branch 'feat/fast-id-generation' of github.com:getsentry/sentry…
lbloder Nov 8, 2024
3293382
Merge branch 'feat/fast-id-generation' into feat/session-id-as-string
lbloder Nov 8, 2024
45c3cbe
fix Sentry Empty ID, replace dashes if 36 char uuid String is passed …
lbloder Nov 8, 2024
5c2c580
fix Tests for SpanId, add tests for SentryUUID and UUIDStringUtils
lbloder Nov 8, 2024
613cc60
Merge branch 'feat/fast-id-generation' into feat/session-id-as-string
lbloder Nov 8, 2024
1e8c6a7
allow 36 and 32 character session ids
lbloder Nov 8, 2024
22e215e
Merge branch '8.x.x' into feat/session-id-as-string
adinauer Nov 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
allow 36 and 32 character session ids
  • Loading branch information
lbloder committed Nov 8, 2024
commit 1e8c6a784d7e20d28c46d68564cc5ce610fb165c
2 changes: 1 addition & 1 deletion sentry/src/main/java/io/sentry/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ public static final class Deserializer implements JsonDeserializer<Session> {
switch (nextName) {
case JsonKeys.SID:
String sid = reader.nextStringOrNull();
if (sid != null && sid.length() == 32) {
if (sid != null && (sid.length() == 36 || sid.length() == 32)) {
sessionId = sid;
} else {
logger.log(SentryLevel.ERROR, "%s sid is not valid.", sid);
Expand Down
19 changes: 15 additions & 4 deletions sentry/src/test/java/io/sentry/JsonSerializerTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,17 @@ class JsonSerializerTest {
assertSessionData(expectedSession)
}

@Test
fun `session deserializes 32 character id`() {
val sessionId = "c81d4e2ebcf211e6869b7df92533d2db"
val session = createSessionMockData("c81d4e2ebcf211e6869b7df92533d2db")
val jsonSession = serializeToString(session)
// reversing, so we can assert values and not a json string
val expectedSession = fixture.serializer.deserialize(StringReader(jsonSession), Session::class.java)

assertSessionData(expectedSession, "c81d4e2ebcf211e6869b7df92533d2db")
}

@Test
fun `When deserializing an Envelope, all the values should be set to the SentryEnvelope object`() {
val jsonEnvelope = FileFromResources.invoke("envelope_session.txt")
Expand Down Expand Up @@ -1248,9 +1259,9 @@ class JsonSerializerTest {
assertEquals(replayRecording, deserializedRecording)
}

private fun assertSessionData(expectedSession: Session?) {
private fun assertSessionData(expectedSession: Session?, expectedSessionId: String = "c81d4e2e-bcf2-11e6-869b-7df92533d2db") {
assertNotNull(expectedSession)
assertEquals("c81d4e2e-bcf2-11e6-869b-7df92533d2db", expectedSession.sessionId)
assertEquals(expectedSessionId, expectedSession.sessionId)
assertEquals("123", expectedSession.distinctId)
assertTrue(expectedSession.init!!)
assertEquals("2020-02-07T14:16:00.000Z", DateUtils.getTimestamp(expectedSession.started!!))
Expand Down Expand Up @@ -1280,14 +1291,14 @@ class JsonSerializerTest {
private fun generateEmptySentryEvent(date: Date = Date()): SentryEvent =
SentryEvent(date)

private fun createSessionMockData(): Session =
private fun createSessionMockData(sessionId: String = "c81d4e2e-bcf2-11e6-869b-7df92533d2db"): Session =
Session(
Session.State.Ok,
DateUtils.getDateTime("2020-02-07T14:16:00.000Z"),
DateUtils.getDateTime("2020-02-07T14:16:00.000Z"),
2,
"123",
"c81d4e2e-bcf2-11e6-869b-7df92533d2db",
sessionId,
true,
123456.toLong(),
6000.toDouble(),
Expand Down
2 changes: 1 addition & 1 deletion sentry/src/test/java/io/sentry/cache/CacheStrategyTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class CacheStrategyTest {
DateUtils.getDateTime("2020-02-07T14:16:00.000Z"),
2,
"123",
"c81d4e2e-bcf2-11e6-869b-7df92533d2db",
"c81d4e2ebcf211e6869b7df92533d2db",
init,
123456.toLong(),
6000.toDouble(),
Expand Down
Loading