Skip to content

Commit c1bfc93

Browse files
committed
Implement PR feedback
1 parent ccb6c74 commit c1bfc93

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

dart/lib/src/environment_variables.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,13 @@ void setEnvironmentVariables(SentryOptions options, EnvironmentVariables vars) {
1414
// options has precendence over vars
1515
options.dsn = options.dsn ?? vars.dsn;
1616

17+
var environment = options.platformChecker.environment;
18+
options.environment = options.environment ?? environment;
19+
1720
// vars has precedence over options
1821
options.environment = vars.environment ?? options.environment;
22+
23+
// vars has precedence over options
1924
options.release = vars.release ?? options.release;
2025
options.dist = vars.dist ?? options.dist;
2126
}

dart/lib/src/platform_checker.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import '../sentry.dart';
1+
import 'sentry_options.dart';
22

33
/// Helper to check in which enviroment the library is running.
44
/// The envirment checks (release/debug/profile) are mutually exclusive.

dart/lib/src/sentry_options.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ import 'platform_checker.dart';
1515
/// Default Environment is none is set
1616
const defaultEnvironment = 'production';
1717

18-
/// Sentry SDK options
1918
// TODO: Scope observers, enableScopeSync
2019
// TODO: shutdownTimeout, flushTimeoutMillis
2120
// https://api.dart.dev/stable/2.10.2/dart-io/HttpClient/close.html doesn't have a timeout param, we'd need to implement manually
21+
22+
/// Sentry SDK options
2223
class SentryOptions {
2324
/// Default Log level if not specified Default is DEBUG
2425
static final SentryLevel _defaultDiagnosticLevel = SentryLevel.debug;

flutter/lib/src/default_integrations.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,7 @@ class LoadAndroidImageListIntegration
340340
/// a PackageInfo wrapper to make it testable
341341
typedef PackageLoader = Future<PackageInfo> Function();
342342

343-
/// an Integration that loads the Release version from Native Apps
344-
/// or SENTRY_RELEASE and SENTRY_DIST variables
343+
/// An [Integration] that loads the release version from native apps
345344
class LoadReleaseIntegration extends Integration<SentryFlutterOptions> {
346345
final PackageLoader _packageLoader;
347346

@@ -350,7 +349,7 @@ class LoadReleaseIntegration extends Integration<SentryFlutterOptions> {
350349
@override
351350
FutureOr<void> call(Hub hub, SentryFlutterOptions options) async {
352351
try {
353-
// For web we read the environment variables in sentry_dart
352+
// For non Flutter apps, we read the environment variables in sentry_dart
354353
if (!kIsWeb) {
355354
final packageInfo = await _packageLoader();
356355
final release =

0 commit comments

Comments
 (0)