Skip to content

Commit

Permalink
Merge branch 'main' into feat/isar-crumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
denrase committed Jan 8, 2024
2 parents 6c65e57 + ca7f531 commit 8bc4e9f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
- We only get the info if online/offline on web platform. The added breadcrumb is set to either `wifi` or `none`.
- APM for isar ([#1726](https://github.com/getsentry/sentry-dart/pull/1726))
- Add isar breadcrumbs ([#1800](https://github.com/getsentry/sentry-dart/pull/1800))
- Starting with Flutter 3.16, Sentry adds the [`appFlavor`](https://api.flutter.dev/flutter/services/appFlavor-constant.html) to the `flutter_context` ([#1799](https://github.com/getsentry/sentry-dart/pull/1799))

### Dependencies

- Bump Android SDK from v7.0.0 to v7.1.0 ([#1788](https://github.com/getsentry/sentry-dart/pull/1788))
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#710)
- [diff](https://github.com/getsentry/sentry-java/compare/7.0.0...7.1.0)

## 7.14.0

Expand Down
2 changes: 1 addition & 1 deletion flutter/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ android {
}

dependencies {
api 'io.sentry:sentry-android:7.0.0'
api 'io.sentry:sentry-android:7.1.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"

// Required -- JUnit 4 framework
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ import io.sentry.SentryEvent
import io.sentry.SentryLevel
import io.sentry.SentryOptions
import io.sentry.android.core.ActivityFramesTracker
import io.sentry.android.core.AppStartState
import io.sentry.android.core.BuildConfig.VERSION_NAME
import io.sentry.android.core.LoadClass
import io.sentry.android.core.SentryAndroid
import io.sentry.android.core.SentryAndroidOptions
import io.sentry.android.core.performance.AppStartMetrics
import io.sentry.protocol.DebugImage
import io.sentry.protocol.SdkVersion
import io.sentry.protocol.SentryId
Expand Down Expand Up @@ -140,8 +140,9 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
result.success(null)
return
}
val appStartTime = AppStartState.getInstance().appStartTime
val isColdStart = AppStartState.getInstance().isColdStart

val appStartTime = AppStartMetrics.getInstance().appStartTimeSpan.startTimestamp
val isColdStart = AppStartMetrics.getInstance().appStartType == AppStartMetrics.AppStartType.COLD

if (appStartTime == null) {
Log.w("Sentry", "App start won't be sent due to missing appStartTime")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ class FlutterEnricherEventProcessor implements EventProcessor {
// See https://github.com/flutter/flutter/issues/83919
// 'window_is_visible': _window.viewConfiguration.visible,
if (renderer != null) 'renderer': renderer,
if (_appFlavor != null) 'appFlavor': _appFlavor!,
};
}

Expand Down Expand Up @@ -266,3 +267,10 @@ class FlutterEnricherEventProcessor implements EventProcessor {
return null;
}
}

/// Copied from https://api.flutter.dev/flutter/services/appFlavor-constant.html
/// As soon as Flutter 3.16 is the minimal supported version of Sentry, this
/// can be replaced with the property from the link above.
const String? _appFlavor = String.fromEnvironment('FLUTTER_APP_FLAVOR') != ''
? String.fromEnvironment('FLUTTER_APP_FLAVOR')
: null;

0 comments on commit 8bc4e9f

Please sign in to comment.