Skip to content

Releases: getsentry/sentry-dart

8.12.0

23 Dec 17:20
Compare
Choose a tag to compare

Deprecations

Fixes

  • Missing replay gestures on Android (#2515)
  • Replay mask sizing on scaling transform widget children (#2520)
  • Masking semi-transparent widgets (#2472)
  • Check SentryTracer type in TTFD tracker (#2508)

Features

  • Replay: device orientation change support & improve video size fit on Android (#2462)

  • Support custom Sentry.runZoneGuarded zone creation (#2088)

    • Sentry will not create a custom zone anymore if it is started within a custom one.
    • This fixes Zone miss-match errors when trying to initialize WidgetsBinding before Sentry on Flutter Web
    • Sentry.runZonedGuarded creates a zone and also captures exceptions & breadcrumbs automatically.
    Sentry.runZonedGuarded(() {
      WidgetsBinding.ensureInitialized();
    
      // Errors before init will not be handled by Sentry
    
      SentryFlutter.init(
        (options) {
        ...
        },
        appRunner: () => runApp(MyApp()),
      );
    } (error, stackTrace) {
      // Automatically sends errors to Sentry, no need to do any
      // captureException calls on your part.
      // On top of that, you can do your own custom stuff in this callback.
    });
  • Warning (in a debug build) if a potentially sensitive widget is not masked or unmasked explicitly (#2375)

  • Replay: ensure visual update before capturing screenshots (#2527)

Dependencies

8.12.0-beta.2

20 Dec 13:38
Compare
Choose a tag to compare
8.12.0-beta.2 Pre-release
Pre-release

Deprecations

Fixes

  • Missing replay gestures on Android (#2515)
  • Replay mask sizing on scaling transform widget children (#2520)

Enhancements

  • Check SentryTracer type in TTFD tracker (#2508)
  • Warning (in a debug build) if a potentially sensitive widget is not masked or unmasked explicitly (#2375)
  • Replay: ensure visual update before capturing screenshots (#2527)

Dependencies

8.11.2

19 Dec 22:52
Compare
Choose a tag to compare

Changes

  • Windows & Linux native crash handlers: add SENTRY_NATIVE_BACKEND env var with default setting of none. (#2522)
    Native crash reporting support with sentry-native's crashpad was added in v8.11.0 and has caused build-time issues
    for some users, because it required newer build tools (newer versions of MSVC/Clang/GCC) than base Flutter SDK.
    This broke the ability to build the app for some users compiling Windows and Linux apps with older toolchains.

    To avoid this issue, we're disabling the native crash handling by default for Linux and Windows for now.
    You can enable it manually by setting the SENTRY_NATIVE_BACKEND=crashpad environment variable before running flutter build.
    You can read more about available backends that fit your use-case in sentry-native docs.

    We plan to change the default back to crashpad in the next major SDK release.

8.11.1

16 Dec 09:42
Compare
Choose a tag to compare

Improvements

  • Check for type before casting in TTID (#2497)

Fixes

  • SentryWidgetsFlutterBinding initializing even if a binding already exists (#2494)

8.12.0-beta.1

10 Dec 16:04
Compare
Choose a tag to compare
8.12.0-beta.1 Pre-release
Pre-release

Features

  • Replay: device orientation change support & improve video size fit on Android (#2462)
  • Support custom Sentry.runZoneGuarded zone creation (#2088)
    • Sentry will not create a custom zone anymore if it is started within a custom one.
    • This fixes Zone miss-match errors when trying to initialize WidgetsBinding before Sentry on Flutter Web
    • Sentry.runZonedGuarded creates a zone and also captures exceptions & breadcrumbs automatically.
    Sentry.runZonedGuarded(() {
      WidgetsBinding.ensureInitialized();
    
      // Errors before init will not be handled by Sentry
    
      SentryFlutter.init(
        (options) {
        ...
        },
        appRunner: () => runApp(MyApp()),
      );
    } (error, stackTrace) {
      // Automatically sends errors to Sentry, no need to do any
      // captureException calls on your part.
      // On top of that, you can do your own custom stuff in this callback.
    });

Fixes

  • Masking semi-transparent widgets (#2472)

8.11.0

10 Dec 12:07
Compare
Choose a tag to compare

⚠️ We recommend skipping this version due to a possibility in the UI thread hanging on app start.

Features

  • Support for screenshot PII content masking (#2361)
    By default, masking is enabled for SessionReplay. To also enable it for screenshots captured with events, you can specify options.experimental.privacy:

    await SentryFlutter.init(
      (options) {
        ...
        // the defaults are:
        options.experimental.privacy.maskAllText = true;
        options.experimental.privacy.maskAllImages = true;
        options.experimental.privacy.maskAssetImages = false;
        // you cal also set up custom masking, for example:
        options.experimental.privacy.mask<WebView>();
      },
      appRunner: () => runApp(MyApp()),
    );

    Actually, just accessing this field will cause it to be initialized with the default settings to mask all text and images:

    await SentryFlutter.init(
      (options) {
        ...
        // this has a side-effect of creating the default privacy configuration, thus enabling Screenshot masking:
        options.experimental.privacy;
      },
      appRunner: () => runApp(MyApp()),
    );
  • Linux native error & obfuscation support (#2431)

  • Improve Device context on plain Dart and Flutter desktop apps (#2441)

  • Add debounce to capturing screenshots (#2368)

    • Per default, screenshots are debounced for 2 seconds.

    • If you need more granular screenshots, you can opt out of debouncing:

      await SentryFlutter.init((options) {
        options.beforeCaptureScreenshot = (event, hint, debounce) {
          if (debounce) {
            return true; // Capture screenshot even if the SDK wants to debounce it.
          } else {
            // check event and hint
            ...
          }
        };
      });
    • Replace deprecated BeforeScreenshotCallback with new BeforeCaptureCallback.

  • Windows native error & obfuscation support (#2286, #2426)

  • Improve app start measurements by using addTimingsCallback instead of addPostFrameCallback to determine app start end (#2405)

    • ⚠️ This change may result in reporting of shorter app start durations
  • Improve frame tracking accuracy (#2372)

    • Introduces SentryWidgetsFlutterBinding that tracks a frame starting from handleBeginFrame and ending in handleDrawFrame, this is approximately the buildDuration time

    • By default, SentryFlutter.init() automatically initializes SentryWidgetsFlutterBinding through the WidgetsFlutterBindingIntegration

    • If you need to initialize the binding before SentryFlutter.init, use SentryWidgetsFlutterBinding.ensureInitialized instead of WidgetsFlutterBinding.ensureInitialized:

      void main() async {
        // Replace WidgetsFlutterBinding.ensureInitialized()
        SentryWidgetsFlutterBinding.ensureInitialized();
      
        await SentryFlutter.init(...);
        runApp(MyApp());
      }
    • ⚠️ Frame tracking will be disabled if a different binding is used

Enhancements

  • Only send debug images referenced in the stacktrace for events (#2329)
  • Remove sentry frames if SDK falls back to current stack trace (#2351)
    • Flutter doesn't always provide stack traces for unhandled errors - this is normal Flutter behavior
    • When no stack trace is provided (in Flutter errors, captureException, or captureMessage):
      • SDK creates a synthetic trace using StackTrace.current
      • Internal SDK frames are removed to reduce noise
    • Original stack traces (when provided) are left unchanged

Fixes

  • Catch errors thrown during handleBeginFrame and handleDrawFrame (#2446)
  • OS & device contexts missing on Windows (#2439)
  • Native iOS/macOS SDK session didn't start after Flutter hot-restart (#2452)
  • Kotlin 2.1.0 compatibility on Android, bump Kotlin language version from 1.4 to 1.6 (#2456)
  • Apply default IP address ({{auto}}) to transactions (#2395)
    • Previously, transactions weren't getting the default IP address when user context was loaded
    • Now consistently applies default IP address to both events and transactions when:
      • No user context exists
      • User context exists but IP address is null

Dependencies

8.11.0-beta.2

02 Dec 17:40
562172b
Compare
Choose a tag to compare
8.11.0-beta.2 Pre-release
Pre-release

Features

  • Support for screenshot PII content masking (#2361)
    By default, masking is enabled for SessionReplay. To also enable it for screenshots captured with events, you can specify options.experimental.privacy:
    await SentryFlutter.init(
      (options) {
        ...
        // the defaults are:
        options.experimental.privacy.maskAllText = true;
        options.experimental.privacy.maskAllImages = true;
        options.experimental.privacy.maskAssetImages = false;
        // you cal also set up custom masking, for example:
        options.experimental.privacy.mask<WebView>();
      },
      appRunner: () => runApp(MyApp()),
    );
    Actually, just accessing this field will cause it to be initialized with the default settings to mask all text and images:
    await SentryFlutter.init(
      (options) {
        ...
        // this has a side-effect of creating the default privacy configuration, thus enabling Screenshot masking:
        options.experimental.privacy;
      },
      appRunner: () => runApp(MyApp()),
    );
  • Linux native error & obfuscation support (#2431)
  • Improve Device context on plain Dart and Flutter desktop apps (#2441)
  • Add debounce to capturing screenshots (#2368)
    • Per default, screenshots are debounced for 2 seconds.
    • If you need more granular screenshots, you can opt out of debouncing:
    await SentryFlutter.init((options) {
      options.beforeCaptureScreenshot = (event, hint, debounce) {
        if (debounce) {
          return true; // Capture screenshot even if the SDK wants to debounce it.
        } else {
          // check event and hint
          ...
        }
      };
    });
    • Replace deprecated BeforeScreenshotCallback with new BeforeCaptureCallback.

Fixes

  • Catch errors thrown during handleBeginFrame and handleDrawFrame (#2446)
  • OS & device contexts missing on Windows (#2439)
  • Native iOS/macOS SDK session didn't start after Flutter hot-restart (#2452)
  • Kotlin 2.1.0 compatibility on Android, bump Kotlin language version from 1.4 to 1.6 (#2456)

Dependencies

8.11.0-beta.1

21 Nov 16:38
Compare
Choose a tag to compare
8.11.0-beta.1 Pre-release
Pre-release

Features

  • Windows native error & obfuscation support (#2286, #2426)
  • Improve app start measurements by using addTimingsCallback instead of addPostFrameCallback to determine app start end (#2405)
    • ⚠️ This change may result in reporting of shorter app start durations
  • Improve frame tracking accuracy (#2372)
    • Introduces SentryWidgetsFlutterBinding that tracks a frame starting from handleBeginFrame and ending in handleDrawFrame, this is approximately the buildDuration time
    • By default, SentryFlutter.init() automatically initializes SentryWidgetsFlutterBinding through the WidgetsFlutterBindingIntegration
    • If you need to initialize the binding before SentryFlutter.init, use SentryWidgetsFlutterBinding.ensureInitialized instead of WidgetsFlutterBinding.ensureInitialized:
    void main() async {
      // Replace WidgetsFlutterBinding.ensureInitialized()
      SentryWidgetsFlutterBinding.ensureInitialized();
    
      await SentryFlutter.init(...);
      runApp(MyApp());
    }
    • ⚠️ Frame tracking will be disabled if a different binding is used

Enhancements

  • Only send debug images referenced in the stacktrace for events (#2329)
  • Remove sentry frames if SDK falls back to current stack trace (#2351)
    • Flutter doesn't always provide stack traces for unhandled errors - this is normal Flutter behavior
    • When no stack trace is provided (in Flutter errors, captureException, or captureMessage):
      • SDK creates a synthetic trace using StackTrace.current
      • Internal SDK frames are removed to reduce noise
    • Original stack traces (when provided) are left unchanged

Fixes

  • Apply default IP address ({{auto}}) to transactions (#2395)
    • Previously, transactions weren't getting the default IP address when user context was loaded
    • Now consistently applies default IP address to both events and transactions when:
      • No user context exists
      • User context exists but IP address is null

Dependencies

8.10.1 (Stable)

08 Nov 15:09
Compare
Choose a tag to compare

Fixes

  • Android build error when compiling (#2397)

8.10.0

08 Nov 10:55
Compare
Choose a tag to compare

Features

  • Emit transaction.data inside contexts.trace.data (#2284)

  • Blocking app starts span if "appLaunchedInForeground" is false. (Android only) (#2291)

  • Replay: user-configurable masking (redaction) for widget classes and specific widget instances. (#2324)
    Some examples of the configuration:

    await SentryFlutter.init(
      (options) {
        ...
        options.experimental.replay.mask<IconButton>();
        options.experimental.replay.unmask<Image>();
        options.experimental.replay.maskCallback<Text>(
            (Element element, Text widget) =>
                (widget.data?.contains('secret') ?? false)
                    ? SentryMaskingDecision.mask
                    : SentryMaskingDecision.continueProcessing);
      },
      appRunner: () => runApp(MyApp()),
    );

    Also, you can wrap any of your widgets with SentryMask() or SentryUnmask() widgets to mask/unmask them, respectively. For example:

     SentryUnmask(Text('Not secret at all'));
  • Support captureFeedback (#2230)

    • Deprecated Sentry.captureUserFeedback, use captureFeedback instead.
    • Deprecated Hub.captureUserFeedback, use captureFeedback instead.
    • Deprecated SentryClient.captureUserFeedback, use captureFeedback instead.
    • Deprecated SentryUserFeedback, use SentryFeedback instead.
  • Add SentryFeedbackWidget (#2240)

    Navigator.push(
      context,
      MaterialPageRoute(
        builder: (context) => SentryFeedbackWidget(associatedEventId: id),
        fullscreenDialog: true,
      ),
    );
  • Add screenshot to SentryFeedbackWidget (#2369)

    • Use SentryFlutter.captureScreenshot to create a screenshot attachment
    • Call SentryFeedbackWidget with this attachment to add it to the user feedback
    final id = await Sentry.captureMessage('UserFeedback');
    final screenshot = await SentryFlutter.captureScreenshot();
    
    Navigator.push(
      context,
      MaterialPageRoute(
        builder: (context) => SentryFeedbackWidget(
            associatedEventId: id,
            screenshot: screenshot,
        ),
        fullscreenDialog: true,
      ),
    );

Enhancements

  • Avoid sending too many empty client reports when Http Transport is used (#2380)
  • Cache parsed DSN (#2365)
  • Handle backpressure earlier in pipeline (#2371)
    • Drops max un-awaited parallel tasks earlier, so event processors & callbacks are not executed for them.
    • Change by setting SentryOptions.maxQueueSize. Default is 30.
  • Use native spotlight integrations on Flutter Android, iOS, macOS (#2285)
  • Improve app start integration (#2266)
    • Fixes pendingTimer during tests (#2103)
    • Fixes transaction slows app start (#2233)
  • Only store slow and frozen frames for frame delay calculation (#2337)
  • Add ReplayIntegration to the integrations list on events when replay is enabled. (#2349)

Fixes

  • App lag with frame tracking enabled when span finishes after a long time (#2311)
  • Only start frame tracking if we receive valid display refresh data (#2307)
  • Rounding error used on frames.total and reject frame measurements if frames.total is less than frames.slow or frames.frozen (#2308)
  • iOS replay integration when only onErrorSampleRate is specified (#2306)
  • Fix TTID timing issue (#2326)
  • TTFD fixes
    • Start missing TTFD for root screen transaction (#2332)
    • Match TTFD to TTID end timespan if TTFD is unfinished when user navigates to another screen (#2347)
    • TTFD measurements should only be added for successful TTFD spans (#2348)
    • Error when calling SentryFlutter.reportFullyDisplayed() twice (#2339)
  • Accessing invalid json fields from fetchNativeAppStart should return null (#2340)

Deprecate

Dependencies