Skip to content

9.0.0

Compare
Choose a tag to compare
@sentry-release-bot sentry-release-bot released this 16 Jun 13:16

Version 9.0.0 marks a major release of the Sentry Dart/Flutter SDKs containing breaking changes.

The goal of this release is the following:

  • Bump the minimum Dart and Flutter versions to 3.5.0 and 3.24.0 respectively
  • Bump the minimum Android API version to 21
  • Add interoperability with the Sentry Javascript SDK in Flutter Web for features such as release health and reporting native JS errors
  • GA the Session Replay feature
  • Provide feature flag support as well as Firebase Remote Config support
  • Trim down unused and potentially confusing APIs

How To Upgrade

Please carefully read through the migration guide in the Sentry docs on how to upgrade from version 8 to version 9

Breaking changes

  • Increase minimum SDK version requirements to Dart v3.5.0 and Flutter v3.24.0 (#2643)
  • Update naming of LoadImagesListIntegration to LoadNativeDebugImagesIntegration (#2833)
  • Set sentry-native backend to crashpad by default and breakpad for Windows ARM64 (#2791)
    • Setting the SENTRY_NATIVE_BACKEND environment variable will override the defaults.
  • Remove manual TTID implementation (#2668)
  • Remove screenshot option attachScreenshotOnlyWhenResumed (#2664)
  • Remove deprecated beforeScreenshot (#2662)
  • Remove old user feedback api (#2686)
    • This is replaced by beforeCaptureScreenshot
  • Remove deprecated loggers (#2685)
  • Remove user segment (#2687)
  • Enable Sentry JS SDK native integration by default (#2688)
  • Remove enableTracing (#2695)
  • Remove options.autoAppStart and setAppStartEnd (#2680)
  • Bump Drift min version to 2.24.0 and use QueryInterceptor instead of QueryExecutor (#2679)
  • Add hint for transactions (#2675)
    • BeforeSendTransactionCallback now has a Hint parameter
  • Remove dart:html usage in favour of package:web (#2710)
  • Remove max response body size (#2709)
    • Responses are now only attached if size is below ~0.15mb
    • Responses are attached to the Hint object, which can be read in beforeSend/beforeSendTransaction callbacks via hint.response.
    • For now, only the dio integration is supported.
  • Enable privacy masking for screenshots by default (#2728)
  • Set option anrEnabled to true by default (#2878)
  • Mutable Data Classes (#2818)
    • Some SDK classes do not have const constructors anymore.
    • The copyWith and clone methods of SDK classes were deprecated.
// old
options.beforeSend = (event, hint) {
  event = event.copyWith(release: 'my-release');
  return event;
}
// new
options.beforeSend = (event, hint) {
  event.release = 'my-release';
  return event;
}

Features

  • Sentry Structured Logs Beta (#2919)
    • The old SentryLogger has been renamed to SdkLogCallback and can be accessed through options.log now.
    • Adds support for structured logging though Sentry.logger:
// Enable in `SentryOptions`:
options.enableLogs = true;

// Use `Sentry.logger`
Sentry.logger.info("This is a info log.");
Sentry.logger.warn("This is a warning log with attributes.", attributes: {
  'string-attribute': SentryLogAttribute.string('string'),
  'int-attribute': SentryLogAttribute.int(1),
  'double-attribute': SentryLogAttribute.double(1.0),
  'bool-attribute': SentryLogAttribute.bool(true),
});
  • Add support for feature flags and integration with Firebase Remote Config (#2825, #2837)
// Manually track a feature flag
Sentry.addFeatureFlag('my-feature', true);

// or use the Sentry Firebase Remote Config Integration (sentry_firebase_remote_config package is required)
// Add the integration to automatically track feature flags from firebase remote config.
await SentryFlutter.init(
  (options) {
    options.dsn = 'https://example@sentry.io/add-your-dsn-here';
    options.addIntegration(
      SentryFirebaseRemoteConfigIntegration(
        firebaseRemoteConfig: yourFirebaseRemoteConfig,
      ),
    );
  },
);
  • Properly generates and links trace IDs for errors and spans (#2869, #2861):
    • With SentryNavigatorObserver - each navigation event starts a new trace.
    • Without SentryNavigatorObserver on non-web platforms - a new trace is started from app
      lifecycle hooks.
    • Web without SentryNavigatorObserver - the same trace ID is reused until the page is
      refreshed or closed.
  • Add support for Flutter Web release health (#2794)
    • Requires using SentryNavigatorObserver;

Behavioral changes

  • Set log level to warning by default when debug = true (#2836)
  • Set HTTP client breadcrumbs log level based on response status code (#2847)
    • 5xx is mapped to SentryLevel.error
    • 4xx is mapped to SentryLevel.warning
  • Parent-child relationship for the PlatformExceptions and Cause (#2803)
    • Improves and more accurately represent exception groups
    • Disabled by default as it may cause issues to group differently
    • You can enable this feature by setting options.groupException = true

Improvements

  • Replay: improve Android native interop performance by using JNI (#2670)
  • Align User Feedback API (#2949)
    • Don’t apply breadcrumbs and extras from scope to feedback events
    • Capture session replay when processing feedback events
    • Record feedback client report for dropped feedback events
    • Record feedback client report for errors when using HttpTransport
  • Truncate feedback message to max 4096 characters (#2954)
  • Replay: Mask RichText Widgets by default (#2975)

Dependencies