getsentry / sentry-docs

Sentry's documentation (and tools to build it)
https://docs.sentry.io
Other
332 stars 1.46k forks source link

enableAutoSessionTracking should be set to false in the session example #5953

Closed Prithvirajkumar closed 1 year ago

Prithvirajkumar commented 1 year ago

Core or SDK?

Platform/SDK

Which part? Which one?

Flutter SDK

Description

Within https://docs.sentry.io/platforms/flutter/configuration/releases/#sessions, the second example has the following code:

import 'package:flutter/widgets.dart';
import 'package:sentry_flutter/sentry_flutter.dart';

Future<void> main() async {
  await SentryFlutter.init(
    (options) => options.enableAutoSessionTracking = true, // it's enabled by default
    appRunner: () => runApp(MyApp()),
  );
}

With the following text above it "If you'd like to opt out of this feature, you can do so using options."

This is incorrect as options.enableAutoSessionTracking should be set to false to opt out of tracking sessions.

This can be further validated when compared with other docs, example: https://docs.sentry.io/platforms/apple/guides/ios/configuration/releases/#sessions

Suggested Solution

Replace the above code with:

import 'package:flutter/widgets.dart';
import 'package:sentry_flutter/sentry_flutter.dart';

Future<void> main() async {
  await SentryFlutter.init(
    (options) => options.enableAutoSessionTracking = false, // it's enabled by default
    appRunner: () => runApp(MyApp()),
  );
}
github-actions[bot] commented 1 year ago

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀