Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Deprecations

- Deprecate `autoAppStart` and `setAppStartEnd` ([#2681](https://github.com/getsentry/sentry-dart/pull/2681))

### Other

- Remove macOS display refresh rate support ([#2628](https://github.com/getsentry/sentry-dart/pull/2628))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class NativeAppStartIntegration extends Integration<SentryFlutterOptions> {
DateTime? _appStartEnd;

/// This timestamp marks the end of app startup. Either set by calling
// ignore: deprecated_member_use_from_same_package
/// [SentryFlutter.setAppStartEnd]. The [SentryFlutterOptions.autoAppStart]
/// option needs to be false.
@internal
Expand All @@ -43,6 +44,7 @@ class NativeAppStartIntegration extends Integration<SentryFlutterOptions> {

try {
DateTime? appStartEnd;
// ignore: deprecated_member_use_from_same_package
if (options.autoAppStart) {
// ignore: invalid_use_of_internal_member
appStartEnd = DateTime.fromMicrosecondsSinceEpoch(timings.first
Expand Down
2 changes: 2 additions & 0 deletions flutter/lib/src/sentry_flutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@
/// Manually set when your app finished startup. Make sure to set
/// [SentryFlutterOptions.autoAppStart] to false on init. The timeout duration
/// for this to work is 10 seconds.
@Deprecated(

Check warning on line 233 in flutter/lib/src/sentry_flutter.dart

View check run for this annotation

Codecov / codecov/patch

flutter/lib/src/sentry_flutter.dart#L233

Added line #L233 was not covered by tests
'Will be removed in v9. This functionality will not be supported anymore.')
static void setAppStartEnd(DateTime appStartEnd) {
// ignore: invalid_use_of_internal_member
final integrations = Sentry.currentHub.options.integrations
Expand Down
2 changes: 2 additions & 0 deletions flutter/lib/src/sentry_flutter_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ class SentryFlutterOptions extends SentryOptions {
/// first transaction. Set to false when configuring option to disable or if
/// you want to set the end time of app startup manually using
/// [SentryFlutter.setAppStartEnd].
@Deprecated(
'Will be removed in v9. In order to disable app starts disable it via option.removeIntegration(...) instead')
bool autoAppStart = true;

/// Automatically attaches a screenshot when capturing an error or exception.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ void main() {

test('with disabled auto app start waits until appStartEnd is set',
() async {
// ignore: deprecated_member_use_from_same_package
fixture.options.autoAppStart = false;

fixture.callIntegration();
Expand All @@ -137,6 +138,7 @@ void main() {
});

test('with disabled auto app start waits until timeout', () async {
// ignore: deprecated_member_use_from_same_package
fixture.options.autoAppStart = false;

fixture.callIntegration();
Expand Down
Loading