Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
74ac939
build(deps): bump actions/setup-java from 4.7.0 to 4.7.1
dependabot[bot] Apr 15, 2025
642b845
Merge pull request #2178 from bugsnag/main
YYChen01988 Apr 15, 2025
e48fa2f
Merge pull request #2176 from bugsnag/dependabot/github_actions/actio…
lemnik Apr 15, 2025
9a3d4d4
build(deps): bump github/codeql-action from 3.28.15 to 3.28.16
dependabot[bot] Apr 29, 2025
9a3a941
increase avd timeout to 120 seconds
joshedney May 1, 2025
453783c
Merge pull request #2181 from bugsnag/je/increase-avd-timeout
joshedney May 1, 2025
a9a0bbb
Metadata in leaveBreadcrumb should be nullable (#2180)
YYChen01988 May 2, 2025
68e8aac
Merge pull request #2179 from bugsnag/dependabot/github_actions/githu…
lemnik May 2, 2025
73eb099
fix(startup): DeliveryDelegate now uses the Provider<EventStore> inst…
lemnik May 2, 2025
48b6ee3
fix(EventStore): replaced the direct `EventStore` reference in `Clien…
lemnik May 2, 2025
ebd3d66
Merge pull request #2183 from bugsnag/PLAT-14130/background-eventstore
lemnik May 16, 2025
6888d7e
avd flood test
joshedney May 19, 2025
cc0a9ac
avd flood test
joshedney May 19, 2025
61bc15a
set Instrumentation tests to the isolated queue
joshedney May 19, 2025
f5b1753
Merge pull request #2185 from bugsnag/je/plat-14226-avd
joshedney May 20, 2025
28cf323
Move CI to macOS 15 build queues
May 20, 2025
2fa9403
feat(app) update example app gradle to kotlin and use BGP (#2184)
YYChen01988 May 27, 2025
b1544ce
Merge branch 'next' into tms/macos-15
May 29, 2025
c5ea371
fix(ndk): check malloc result in NDK plugin install
lemnik May 29, 2025
309d90d
Merge pull request #2191 from bugsnag/lemnik/check-init-malloc-failure
lemnik May 29, 2025
cc4cf67
Merge pull request #2192 from bugsnag/tms/macos-15
twometresteve May 29, 2025
035d9d3
Set default endpoints based on API key (#2190)
richardelms May 30, 2025
799630f
v6.14.0
lemnik Jun 4, 2025
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
8 changes: 4 additions & 4 deletions .buildkite/pipeline.full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ steps:
key: "fixture-minimal"
timeout_in_minutes: 30
agents:
queue: macos-14
queue: macos-15
artifact_paths: build/fixture-minimal.apk
command: make fixture-minimal
env:
Expand All @@ -15,7 +15,7 @@ steps:
- label: ':android: Build Example App'
timeout_in_minutes: 10
agents:
queue: macos-14
queue: macos-15
command: 'make example-app'
env:
JAVA_VERSION: 17
Expand All @@ -24,7 +24,7 @@ steps:
key: "fixture-debug"
timeout_in_minutes: 30
agents:
queue: macos-14
queue: macos-15
artifact_paths:
- "build/fixture-debug.apk"
- "build/fixture-debug/*"
Expand All @@ -35,7 +35,7 @@ steps:
- label: ':android: Build Scan'
timeout_in_minutes: 10
agents:
queue: macos-14
queue: macos-15
command: './gradlew clean assembleRelease check --scan'

#
Expand Down
24 changes: 12 additions & 12 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ steps:
- label: 'Audit current licenses'
timeout_in_minutes: 30
agents:
queue: macos-14
queue: macos-15
commands:
- bundle install
- ./scripts/audit-dependency-licenses.sh
Expand All @@ -15,7 +15,7 @@ steps:
key: "fixture-r19"
timeout_in_minutes: 30
agents:
queue: macos-14
queue: macos-15
artifact_paths:
- "build/fixture-r19.apk"
- "build/fixture-r19-url.txt"
Expand All @@ -33,7 +33,7 @@ steps:
key: "fixture-r21"
timeout_in_minutes: 30
agents:
queue: macos-14
queue: macos-15
artifact_paths:
- "build/fixture-r21.apk"
- "build/fixture-r21-url.txt"
Expand All @@ -50,31 +50,31 @@ steps:
- label: ':android: Coding standards checks'
timeout_in_minutes: 20
agents:
queue: macos-14
queue: macos-15
command: './gradlew --continue checkstyle detekt lint ktlintCheck'

- label: ':android: Binary compatibility checks'
timeout_in_minutes: 20
agents:
queue: macos-14
queue: macos-15
command: './gradlew apiCheck'

- label: ':android: CppCheck'
timeout_in_minutes: 10
agents:
queue: macos-14
queue: macos-15
command: 'bash ./scripts/run-cpp-check.sh'

- label: ':android: ClangFormat'
timeout_in_minutes: 10
agents:
queue: macos-14
queue: macos-15
command: 'bash ./scripts/run-clang-format-ci-check.sh'

- label: ':android: Lint mazerunner scenarios'
timeout_in_minutes: 10
agents:
queue: macos-14
queue: macos-15
commands:
- cd features/fixtures/mazerunner
- ./gradlew ktlintCheck detekt checkstyle
Expand All @@ -84,13 +84,13 @@ steps:
- label: ':android: Android size reporting'
timeout_in_minutes: 10
agents:
queue: macos-14
queue: macos-15
command: scripts/run-sizer.sh

- label: ':android: JVM tests'
timeout_in_minutes: 10
agents:
queue: macos-14
queue: macos-15
command: './gradlew test'

- label: ':android: Instrumentation tests'
Expand All @@ -99,7 +99,7 @@ steps:
artifacts#v1.9.0:
upload: "bugsnag-*/build/reports/androidTests/connected/**/*.html"
agents:
queue: macos-14
queue: macos-15-isolated
command: './scripts/run-connected-checks.rb'
env:
API_LEVEL: 30
Expand Down Expand Up @@ -426,7 +426,7 @@ steps:
concurrency_group: 'browserstack-app'
concurrency_method: eager

# Android 11+ devices have the GWP-ASAN tool enabled which randomly samples native memory
# Android 11+ devices have the GWP-ASAN tool enabled which randomly samples native memory
# to detect misuse (such as use-after-free, buffer overflow). If a failure is detected then
# the device will raise a SIGABRT mentioning GWP-ASAN - this can be investigated further
# by inspecting the devices logs.
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
submodules: recursive
- uses: gradle/wrapper-validation-action@f9c9c575b8b21b6485636a91ffecd10e558c62f6 #v3.5.0

- uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 #v4.7.0
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 #v4.7.1
with:
distribution: 'zulu'
java-version: 17
Expand All @@ -64,7 +64,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@45775bd8235c68ba998cffa5171334d58593da47 #v3.28.15
uses: github/codeql-action/init@28deaeda66b76a05916b6923827895f2b14ab387 #v3.28.16
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -83,6 +83,6 @@ jobs:
./gradlew --no-daemon assemble

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@45775bd8235c68ba998cffa5171334d58593da47 #v3.28.15
uses: github/codeql-action/analyze@28deaeda66b76a05916b6923827895f2b14ab387 #v3.28.16
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
uses: github/codeql-action/upload-sarif@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16
with:
sarif_file: results.sarif

Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 6.14.0 (2025-06-04)

### Enhancements

* Set default endpoints based on API key [#2190](https://github.com/bugsnag/bugsnag-android/pull/2190)

* Allow the metadata in `leaveBreadcrumb` to be null rather than enforcing non-null, aligning `bugsnag-android` with our other SDKs
[#2180](https://github.com/bugsnag/bugsnag-android/pull/2180)

### Bug fixes

* Sanity check the allocation in the installation of `bugsnag-plugin-android-ndk` to avoid a possible crash when allocation fails
[#2191](https://github.com/bugsnag/bugsnag-android/pull/2191)

## 6.13.0 (2025-04-15)

### Enhancements
Expand Down
3 changes: 2 additions & 1 deletion bugsnag-android-core/api/bugsnag-android-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ public class com/bugsnag/android/BugsnagVmViolationListener : android/os/StrictM
}

public class com/bugsnag/android/Client : com/bugsnag/android/CallbackAware, com/bugsnag/android/FeatureFlagAware, com/bugsnag/android/MetadataAware, com/bugsnag/android/UserAware {
protected final field eventStore Lcom/bugsnag/android/EventStore;
public fun <init> (Landroid/content/Context;)V
public fun <init> (Landroid/content/Context;Lcom/bugsnag/android/Configuration;)V
public fun <init> (Landroid/content/Context;Ljava/lang/String;)V
Expand Down Expand Up @@ -322,8 +321,10 @@ public final class com/bugsnag/android/EndpointConfiguration {
public fun <init> ()V
public fun <init> (Ljava/lang/String;Ljava/lang/String;)V
public synthetic fun <init> (Ljava/lang/String;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun equals (Ljava/lang/Object;)Z
public final fun getNotify ()Ljava/lang/String;
public final fun getSessions ()Ljava/lang/String;
public fun hashCode ()I
}

public class com/bugsnag/android/Error : com/bugsnag/android/JsonStream$Streamable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ public static void leaveBreadcrumb(@NonNull String message) {
* @param type A category for the breadcrumb
*/
public static void leaveBreadcrumb(@NonNull String message,
@NonNull Map<String, Object> metadata,
@Nullable Map<String, Object> metadata,
@NonNull BreadcrumbType type) {
getClient().leaveBreadcrumb(message, metadata, type);
}
Expand Down
22 changes: 11 additions & 11 deletions bugsnag-android-core/src/main/java/com/bugsnag/android/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public class Client implements MetadataAware, CallbackAware, UserAware, FeatureF
final MemoryTrimState memoryTrimState = new MemoryTrimState();

@NonNull
protected final EventStore eventStore;
private final Provider<EventStore> eventStore;

final SessionTracker sessionTracker;

Expand Down Expand Up @@ -138,7 +138,7 @@ public Unit invoke(Boolean hasConnection, String networkState) {
data.put("networkState", networkState);
leaveAutoBreadcrumb("Connectivity changed", BreadcrumbType.STATE, data);
if (hasConnection) {
eventStore.flushAsync();
getEventStore().flushAsync();
sessionTracker.flushAsync();
}
return null;
Expand Down Expand Up @@ -201,10 +201,10 @@ public Unit invoke(Boolean hasConnection, String networkState) {
dataCollectionModule, bgTaskService, trackerModule, systemServiceModule, notifier,
callbackState);

eventStore = eventStorageModule.getEventStore().get();
eventStore = eventStorageModule.getEventStore();

deliveryDelegate = new DeliveryDelegate(logger, eventStore,
immutableConfig, callbackState, notifier, bgTaskService);
deliveryDelegate = new DeliveryDelegate(logger, eventStore, immutableConfig, callbackState,
notifier, bgTaskService);

exceptionHandler = new ExceptionHandler(this, logger);

Expand Down Expand Up @@ -245,7 +245,7 @@ public Unit invoke(Boolean hasConnection, String networkState) {
@NonNull DeviceDataCollector deviceDataCollector,
@NonNull AppDataCollector appDataCollector,
@NonNull BreadcrumbState breadcrumbState,
@NonNull EventStore eventStore,
@NonNull Provider<EventStore> eventStore,
SystemBroadcastReceiver systemBroadcastReceiver,
SessionTracker sessionTracker,
Connectivity connectivity,
Expand Down Expand Up @@ -296,8 +296,8 @@ private void start() {
}

// Flush any on-disk errors and sessions
eventStore.flushOnLaunch();
eventStore.flushAsync();
eventStore.get().flushOnLaunch();
eventStore.get().flushAsync();
sessionTracker.flushAsync();

// These call into NdkPluginCaller to sync with the native side, so they must happen later
Expand Down Expand Up @@ -961,9 +961,9 @@ public void leaveBreadcrumb(@NonNull String message) {
* @param type A category for the breadcrumb
*/
public void leaveBreadcrumb(@NonNull String message,
@NonNull Map<String, Object> metadata,
@Nullable Map<String, Object> metadata,
@NonNull BreadcrumbType type) {
if (message != null && type != null && metadata != null) {
if (message != null && type != null) {
breadcrumbState.add(new Breadcrumb(message, type, metadata, new Date(), logger));
} else {
logNull("leaveBreadcrumb");
Expand Down Expand Up @@ -1091,7 +1091,7 @@ SessionTracker getSessionTracker() {

@NonNull
EventStore getEventStore() {
return eventStore;
return eventStore.get();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,17 @@ internal class ConfigInternal(
field = value ?: NoopLogger
}
var delivery: Delivery? = null
var endpoints: EndpointConfiguration = EndpointConfiguration()

private fun isHubApiKey(): Boolean =
apiKey?.startsWith(HUB_PREFIX) == true

private var _endpoints: EndpointConfiguration? = null
var endpoints: EndpointConfiguration
get() = _endpoints
?: if (isHubApiKey()) EndpointConfiguration(HUB_NOTIFY, HUB_SESSION)
else EndpointConfiguration(DEFAULT_NOTIFY, DEFAULT_SESSION)
set(value) { _endpoints = value }

var maxBreadcrumbs: Int = DEFAULT_MAX_BREADCRUMBS
var maxPersistedEvents: Int = DEFAULT_MAX_PERSISTED_EVENTS
var maxPersistedSessions: Int = DEFAULT_MAX_PERSISTED_SESSIONS
Expand Down Expand Up @@ -160,7 +170,11 @@ internal class ConfigInternal(
private const val DEFAULT_THREAD_COLLECTION_TIME_LIMIT_MS: Long = 5000
private const val DEFAULT_LAUNCH_CRASH_THRESHOLD_MS: Long = 5000
private const val DEFAULT_MAX_STRING_VALUE_LENGTH = 10000

private const val DEFAULT_NOTIFY = "https://notify.bugsnag.com"
private const val DEFAULT_SESSION = "https://sessions.bugsnag.com"
private const val HUB_NOTIFY = "https://notify.insighthub.smartbear.com"
private const val HUB_SESSION = "https://sessions.insighthub.smartbear.com"
private const val HUB_PREFIX = "00000"
@JvmStatic
fun load(context: Context): Configuration = load(context, null)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.bugsnag.android.internal.BackgroundTaskService;
import com.bugsnag.android.internal.ImmutableConfig;
import com.bugsnag.android.internal.TaskType;
import com.bugsnag.android.internal.dag.Provider;

import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
Expand All @@ -19,14 +20,14 @@ class DeliveryDelegate extends BaseObservable {
static long DELIVERY_TIMEOUT = 3000L;

final Logger logger;
private final EventStore eventStore;
private final Provider<EventStore> eventStore;
private final ImmutableConfig immutableConfig;
private final Notifier notifier;
private final CallbackState callbackState;
final BackgroundTaskService backgroundTaskService;

DeliveryDelegate(Logger logger,
EventStore eventStore,
Provider<EventStore> eventStore,
ImmutableConfig immutableConfig,
CallbackState callbackState,
Notifier notifier,
Expand Down Expand Up @@ -118,7 +119,7 @@ DeliveryStatus deliverPayloadInternal(@NonNull EventPayload payload, @NonNull Ev

private void cacheAndSendSynchronously(@NonNull Event event) {
long cutoffTime = System.currentTimeMillis() + DELIVERY_TIMEOUT;
Future<String> task = eventStore.writeAndDeliver(event);
Future<String> task = eventStore().writeAndDeliver(event);

long timeout = cutoffTime - System.currentTimeMillis();
if (task != null && timeout > 0) {
Expand All @@ -135,9 +136,13 @@ private void cacheAndSendSynchronously(@NonNull Event event) {
}

private void cacheEvent(@NonNull Event event, boolean attemptSend) {
eventStore.write(event);
eventStore().write(event);
if (attemptSend) {
eventStore.flushAsync();
eventStore().flushAsync();
}
}

private EventStore eventStore() {
return eventStore.get();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,22 @@ class EndpointConfiguration(
* Configures the endpoint to which sessions should be sent
*/
val sessions: String = "https://sessions.bugsnag.com"
)
) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false

other as EndpointConfiguration

if (notify != other.notify) return false
if (sessions != other.sessions) return false

return true
}

override fun hashCode(): Int {
var result = notify.hashCode()
result = 31 * result + sessions.hashCode()
return result
}
}
Loading