Skip to content

Commit 014e7fb

Browse files
authored
Merge branch 'main' into markushi/feat/retain-baggage-sample-rate-rand-as-double
2 parents d3775d4 + 801e677 commit 014e7fb

File tree

11 files changed

+72
-12
lines changed

11 files changed

+72
-12
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
4141

4242
- name: Initialize CodeQL
43-
uses: github/codeql-action/init@6bb031afdd8eb862ea3fc1848194185e076637e5 # pin@v2
43+
uses: github/codeql-action/init@5f8171a638ada777af81d42b55959a643bb29017 # pin@v2
4444
with:
4545
languages: 'java'
4646

@@ -49,4 +49,4 @@ jobs:
4949
./gradlew buildForCodeQL
5050
5151
- name: Perform CodeQL Analysis
52-
uses: github/codeql-action/analyze@6bb031afdd8eb862ea3fc1848194185e076637e5 # pin@v2
52+
uses: github/codeql-action/analyze@5f8171a638ada777af81d42b55959a643bb29017 # pin@v2

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
steps:
2020
- name: Get auth token
2121
id: token
22-
uses: actions/create-github-app-token@21cfef2b496dd8ef5b904c159339626a10ad380e # v1.11.6
22+
uses: actions/create-github-app-token@af35edadc00be37caa72ed9f3e6d5f7801bfdf09 # v1.11.7
2323
with:
2424
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
2525
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,19 @@
1010
### Fixes
1111

1212
- Do not override user-defined `SentryOptions` ([#4262](https://github.com/getsentry/sentry-java/pull/4262))
13+
- Session Replay: Change bitmap config to `ARGB_8888` for screenshots ([#4282](https://github.com/getsentry/sentry-java/pull/4282))
14+
15+
### Internal
16+
17+
- Added `platform` to SentryEnvelopeItemHeader ([#4287](https://github.com/getsentry/sentry-java/pull/4287))
18+
- Set `android` platform to ProfileChunk envelope item header
1319

1420
### Dependencies
1521

1622
- Bump Native SDK from v0.8.1 to v0.8.2 ([#4267](https://github.com/getsentry/sentry-java/pull/4267))
1723
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#082)
1824
- [diff](https://github.com/getsentry/sentry-native/compare/0.8.1...0.8.2)
25+
- Bump Spring Boot from 2.7.5 to 2.7.18 ([#3496](https://github.com/getsentry/sentry-java/pull/3496))
1926

2027
## 8.5.0
2128

@@ -571,6 +578,12 @@ If you have been using `8.0.0-rc.4` of the Java SDK, here's the new changes that
571578
- We are planning to improve this in the future but opted for this fix first.
572579
- Fix swallow NDK loadLibrary errors ([#4082](https://github.com/getsentry/sentry-java/pull/4082))
573580

581+
## 7.22.5
582+
583+
### Fixes
584+
585+
- Session Replay: Change bitmap config to `ARGB_8888` for screenshots ([#4282](https://github.com/getsentry/sentry-java/pull/4282))
586+
574587
## 7.22.4
575588

576589
### Fixes

buildSrc/src/main/java/Config.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ object Config {
66
val kotlinVersion = "1.9.24"
77
val kotlinStdLib = "stdlib-jdk8"
88

9-
val springBootVersion = "2.7.5"
9+
val springBootVersion = "2.7.18"
1010
val springBoot3Version = "3.4.2"
1111
val kotlinCompatibleLanguageVersion = "1.6"
1212

sentry-android-replay/src/main/java/io/sentry/android/replay/ScreenshotRecorder.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ internal class ScreenshotRecorder(
5252
Bitmap.createBitmap(
5353
1,
5454
1,
55-
Bitmap.Config.RGB_565
55+
Bitmap.Config.ARGB_8888
5656
)
5757
}
5858
private val screenshot = Bitmap.createBitmap(
5959
config.recordingWidth,
6060
config.recordingHeight,
61-
Bitmap.Config.RGB_565
61+
Bitmap.Config.ARGB_8888
6262
)
6363
private val singlePixelBitmapCanvas: Canvas by lazy(NONE) { Canvas(singlePixelBitmap) }
6464
private val prescaledMatrix by lazy(NONE) {
@@ -216,7 +216,9 @@ internal class ScreenshotRecorder(
216216
fun close() {
217217
unbind(rootView?.get())
218218
rootView?.clear()
219-
screenshot.recycle()
219+
if (!screenshot.isRecycled) {
220+
screenshot.recycle()
221+
}
220222
isCapturing.set(false)
221223
}
222224

sentry/api/sentry.api

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2759,11 +2759,12 @@ public final class io/sentry/SentryEnvelopeItem {
27592759
}
27602760

27612761
public final class io/sentry/SentryEnvelopeItemHeader : io/sentry/JsonSerializable, io/sentry/JsonUnknown {
2762-
public fun <init> (Lio/sentry/SentryItemType;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
2762+
public fun <init> (Lio/sentry/SentryItemType;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
27632763
public fun getAttachmentType ()Ljava/lang/String;
27642764
public fun getContentType ()Ljava/lang/String;
27652765
public fun getFileName ()Ljava/lang/String;
27662766
public fun getLength ()I
2767+
public fun getPlatform ()Ljava/lang/String;
27672768
public fun getType ()Lio/sentry/SentryItemType;
27682769
public fun getUnknown ()Ljava/util/Map;
27692770
public fun serialize (Lio/sentry/ObjectWriter;Lio/sentry/ILogger;)V
@@ -2781,6 +2782,7 @@ public final class io/sentry/SentryEnvelopeItemHeader$JsonKeys {
27812782
public static final field CONTENT_TYPE Ljava/lang/String;
27822783
public static final field FILENAME Ljava/lang/String;
27832784
public static final field LENGTH Ljava/lang/String;
2785+
public static final field PLATFORM Ljava/lang/String;
27842786
public static final field TYPE Ljava/lang/String;
27852787
public fun <init> ()V
27862788
}

sentry/src/main/java/io/sentry/SentryEnvelopeItem.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,9 @@ private static void ensureAttachmentSizeLimit(
302302
SentryItemType.ProfileChunk,
303303
() -> cachedItem.getBytes().length,
304304
"application-json",
305-
traceFile.getName());
305+
traceFile.getName(),
306+
null,
307+
profileChunk.getPlatform());
306308

307309
// avoid method refs on Android due to some issues with older AGP setups
308310
// noinspection Convert2MethodRef

sentry/src/main/java/io/sentry/SentryEnvelopeItemHeader.java

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public final class SentryEnvelopeItemHeader implements JsonSerializable, JsonUnk
1515

1616
private final @Nullable String contentType;
1717
private final @Nullable String fileName;
18+
private final @Nullable String platform;
1819
private final @NotNull SentryItemType type;
1920
private final int length;
2021
@Nullable private final Callable<Integer> getLength;
@@ -46,19 +47,25 @@ public int getLength() {
4647
return fileName;
4748
}
4849

50+
public @Nullable String getPlatform() {
51+
return platform;
52+
}
53+
4954
@ApiStatus.Internal
5055
public SentryEnvelopeItemHeader(
5156
final @NotNull SentryItemType type,
5257
int length,
5358
final @Nullable String contentType,
5459
final @Nullable String fileName,
55-
final @Nullable String attachmentType) {
60+
final @Nullable String attachmentType,
61+
final @Nullable String platform) {
5662
this.type = Objects.requireNonNull(type, "type is required");
5763
this.contentType = contentType;
5864
this.length = length;
5965
this.fileName = fileName;
6066
this.getLength = null;
6167
this.attachmentType = attachmentType;
68+
this.platform = platform;
6269
}
6370

6471
SentryEnvelopeItemHeader(
@@ -67,12 +74,23 @@ public SentryEnvelopeItemHeader(
6774
final @Nullable String contentType,
6875
final @Nullable String fileName,
6976
final @Nullable String attachmentType) {
77+
this(type, getLength, contentType, fileName, attachmentType, null);
78+
}
79+
80+
SentryEnvelopeItemHeader(
81+
final @NotNull SentryItemType type,
82+
final @Nullable Callable<Integer> getLength,
83+
final @Nullable String contentType,
84+
final @Nullable String fileName,
85+
final @Nullable String attachmentType,
86+
final @Nullable String platform) {
7087
this.type = Objects.requireNonNull(type, "type is required");
7188
this.contentType = contentType;
7289
this.length = -1;
7390
this.fileName = fileName;
7491
this.getLength = getLength;
7592
this.attachmentType = attachmentType;
93+
this.platform = platform;
7694
}
7795

7896
SentryEnvelopeItemHeader(
@@ -100,6 +118,7 @@ public static final class JsonKeys {
100118
public static final String TYPE = "type";
101119
public static final String ATTACHMENT_TYPE = "attachment_type";
102120
public static final String LENGTH = "length";
121+
public static final String PLATFORM = "platform";
103122
}
104123

105124
@Override
@@ -116,6 +135,9 @@ public void serialize(final @NotNull ObjectWriter writer, final @NotNull ILogger
116135
if (attachmentType != null) {
117136
writer.name(JsonKeys.ATTACHMENT_TYPE).value(attachmentType);
118137
}
138+
if (platform != null) {
139+
writer.name(JsonKeys.PLATFORM).value(platform);
140+
}
119141
writer.name(JsonKeys.LENGTH).value(getLength());
120142
if (unknown != null) {
121143
for (String key : unknown.keySet()) {
@@ -138,6 +160,7 @@ public static final class Deserializer implements JsonDeserializer<SentryEnvelop
138160
SentryItemType type = null;
139161
int length = 0;
140162
String attachmentType = null;
163+
String platform = null;
141164
Map<String, Object> unknown = null;
142165

143166
while (reader.peek() == JsonToken.NAME) {
@@ -158,6 +181,9 @@ public static final class Deserializer implements JsonDeserializer<SentryEnvelop
158181
case JsonKeys.ATTACHMENT_TYPE:
159182
attachmentType = reader.nextStringOrNull();
160183
break;
184+
case JsonKeys.PLATFORM:
185+
platform = reader.nextStringOrNull();
186+
break;
161187
default:
162188
if (unknown == null) {
163189
unknown = new HashMap<>();
@@ -170,7 +196,8 @@ public static final class Deserializer implements JsonDeserializer<SentryEnvelop
170196
throw missingRequiredFieldException(JsonKeys.TYPE, logger);
171197
}
172198
SentryEnvelopeItemHeader sentryEnvelopeItemHeader =
173-
new SentryEnvelopeItemHeader(type, length, contentType, fileName, attachmentType);
199+
new SentryEnvelopeItemHeader(
200+
type, length, contentType, fileName, attachmentType, platform);
174201
sentryEnvelopeItemHeader.setUnknown(unknown);
175202
reader.endObject();
176203
return sentryEnvelopeItemHeader;

sentry/src/test/java/io/sentry/SentryEnvelopeItemTest.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,18 @@ class SentryEnvelopeItemTest {
462462
)
463463
}
464464

465+
@Test
466+
fun `fromProfileChunk sets platform header`() {
467+
val file = File(fixture.pathname)
468+
val profileChunk = mock<ProfileChunk> {
469+
whenever(it.traceFile).thenReturn(file)
470+
whenever(it.platform).thenReturn("chunk platform")
471+
}
472+
473+
val chunk = SentryEnvelopeItem.fromProfileChunk(profileChunk, mock())
474+
assertEquals("chunk platform", chunk.header.platform)
475+
}
476+
465477
@Test
466478
fun `fromProfileChunk saves file as Base64`() {
467479
val file = File(fixture.pathname)

sentry/src/test/java/io/sentry/protocol/SentryEnvelopeItemHeaderSerializationTest.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ class SentryEnvelopeItemHeaderSerializationTest {
2323
345,
2424
"5def420f-3dac-4d7b-948b-49de6e551aef",
2525
"54cf4644-8610-4ff3-a535-34ac1f367501",
26-
"6f49ad85-a017-4d94-a5d7-6477251da602"
26+
"6f49ad85-a017-4d94-a5d7-6477251da602",
27+
"android"
2728
)
2829
}
2930
private val fixture = Fixture()

0 commit comments

Comments
 (0)