Skip to content

Commit

Permalink
Merge branch 'v7.0.0' into fix/checks-in-some-tests-broken
Browse files Browse the repository at this point in the history
  • Loading branch information
denrase committed Mar 14, 2023
2 parents 8285403 + 9e1312a commit 7aff6ac
Show file tree
Hide file tree
Showing 17 changed files with 56 additions and 36 deletions.
25 changes: 20 additions & 5 deletions .github/workflows/min_version_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ jobs:
with:
access_token: ${{ github.token }}

build:
name: Build
build-android:
runs-on: macos-latest
timeout-minutes: 30

Expand All @@ -32,9 +31,25 @@ jobs:
with:
flutter-version: '3.0.0'
# Add flutter build web (missing index)
- name: Build
- name: Build Android
run: |
cd min_version_test
flutter pub get
flutter build ios --no-codesign
flutter build appbundle
flutter build appbundle
build-ios:
runs-on: macos-latest
timeout-minutes: 30

steps:
- uses: actions/checkout@v3

- uses: subosito/flutter-action@dbf1fa04f4d2e52c33185153d06cdb5443aa189d # pin@v2
with:
flutter-version: '3.0.0'
# Add flutter build web (missing index)
- name: Build iOS
run: |
cd min_version_test
flutter pub get
flutter build ios --no-codesign
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:async';
import 'dart:collection';
import '../event_processor.dart';
import '../hint.dart';
import '../protocol.dart';
import '../sentry_options.dart';

Expand All @@ -26,7 +27,7 @@ class DeduplicationEventProcessor extends EventProcessor {
final SentryOptions _options;

@override
FutureOr<SentryEvent?> apply(SentryEvent event, {hint}) {
FutureOr<SentryEvent?> apply(SentryEvent event, {Hint? hint}) {
if (event is SentryTransaction) {
return event;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'dart:io';

import '../../hint.dart';
import '../../protocol.dart';
import '../../sentry_options.dart';
import 'exception_event_processor.dart';
Expand All @@ -13,7 +14,7 @@ class IoExceptionEventProcessor implements ExceptionEventProcessor {
final SentryOptions _options;

@override
SentryEvent apply(SentryEvent event, {dynamic hint}) {
SentryEvent apply(SentryEvent event, {Hint? hint}) {
final throwable = event.throwable;
if (throwable is HttpException) {
return _applyHttpException(throwable, event);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import '../../hint.dart';
import '../../protocol.dart';
import '../../sentry_options.dart';
import 'exception_event_processor.dart';
Expand All @@ -7,5 +8,5 @@ ExceptionEventProcessor exceptionEventProcessor(SentryOptions _) =>

class WebExcptionEventProcessor implements ExceptionEventProcessor {
@override
SentryEvent apply(SentryEvent event, {dynamic hint}) => event;
SentryEvent apply(SentryEvent event, {Hint? hint}) => event;
}
4 changes: 2 additions & 2 deletions dart/lib/src/scope.dart
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class Scope {

Scope(this._options);

Breadcrumb? _addBreadCrumbSync(Breadcrumb breadcrumb, {dynamic hint}) {
Breadcrumb? _addBreadCrumbSync(Breadcrumb breadcrumb, {Hint? hint}) {
// bail out if maxBreadcrumbs is zero
if (_options.maxBreadcrumbs == 0) {
return null;
Expand Down Expand Up @@ -188,7 +188,7 @@ class Scope {
}

/// Adds a breadcrumb to the breadcrumbs queue
Future<void> addBreadcrumb(Breadcrumb breadcrumb, {dynamic hint}) async {
Future<void> addBreadcrumb(Breadcrumb breadcrumb, {Hint? hint}) async {
final addedBreadcrumb = _addBreadCrumbSync(breadcrumb, hint: hint);
if (addedBreadcrumb != null) {
await _callScopeObservers((scopeObserver) async =>
Expand Down
2 changes: 1 addition & 1 deletion dart/lib/src/version.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ String sdkName(bool isWeb) => isWeb ? _browserSdkName : _ioSdkName;
const String _ioSdkName = 'sentry.dart';

/// The SDK name for web projects reported to Sentry.io in the submitted events.
const String _browserSdkName = 'sentry.dart.browser';
const String _browserSdkName = '$_ioSdkName.browser';

/// The name of the SDK platform reported to Sentry.io in the submitted events.
///
Expand Down
2 changes: 1 addition & 1 deletion dart/test/scope_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ void main() {
scopeObserver: fixture.mockScopeObserver,
beforeBreadcrumbCallback: (
Breadcrumb? breadcrumb, {
dynamic hint,
Hint? hint,
}) {
return breadcrumb?.copyWith(message: "modified");
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import io.sentry.Sentry
import io.sentry.DateUtils
import io.sentry.android.core.ActivityFramesTracker
import io.sentry.android.core.AppStartState
import io.sentry.android.core.BuildConfig.VERSION_NAME
import io.sentry.android.core.LoadClass
import io.sentry.android.core.SentryAndroid
import io.sentry.android.core.SentryAndroidOptions
Expand Down Expand Up @@ -165,16 +166,18 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {

args.getIfNotNull<Boolean>("sendClientReports") { options.isSendClientReports = it }

args.getIfNotNull<Map<String, Any>>("sdk") { sdk ->
val name = sdk["name"] as? String
val version = sdk["version"] as? String
if (name != null && version != null) {
val sdkVersion = SdkVersion(name, version)
options.setSentryClientName("$name/$version")
options.setSdkVersion(sdkVersion)
}
val name = "sentry.java.android.flutter"

var sdkVersion = options.sdkVersion
if (sdkVersion == null) {
sdkVersion = SdkVersion(name, VERSION_NAME)
} else {
sdkVersion.name = name
}

options.sdkVersion = sdkVersion
options.sentryClientName = "$name/$VERSION_NAME"

options.setBeforeSend { event, _ ->
setEventOriginTag(event)
addPackages(event, options.sdkVersion)
Expand Down Expand Up @@ -476,10 +479,10 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
private fun addPackages(event: SentryEvent, sdk: SdkVersion?) {
event.sdk?.let {
if (it.name == flutterSdk) {
sdk?.packages?.forEach { sentryPackage ->
sdk?.packageSet?.forEach { sentryPackage ->
it.addPackage(sentryPackage.name, sentryPackage.version)
}
sdk?.integrations?.forEach { integration ->
sdk?.integrationSet?.forEach { integration ->
it.addIntegration(integration)
}
}
Expand Down
5 changes: 3 additions & 2 deletions flutter/example/macos/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objectVersion = 54;
objects = {

/* Begin PBXAggregateTarget section */
Expand Down Expand Up @@ -209,7 +209,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0920;
LastUpgradeCheck = 0930;
LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "";
TargetAttributes = {
33CC10EC2044A3C60003C045 = {
Expand Down Expand Up @@ -262,6 +262,7 @@
/* Begin PBXShellScriptBuildPhase section */
3399D490228B24CF009A79C7 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1000"
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
8 changes: 3 additions & 5 deletions flutter/ios/Classes/SentryFlutterPluginApple.swift
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,9 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin {
#endif
}

if let sdk = arguments["sdk"] as? [String: Any?],
let name = sdk["name"] as? String,
let version = sdk["version"] as? String {
PrivateSentrySDKOnly.setSdkName(name, andVersionString: version)
}
let name = "sentry.cocoa.flutter"
let version = PrivateSentrySDKOnly.getSdkVersionString()
PrivateSentrySDKOnly.setSdkName(name, andVersionString: version)

// note : for now, in sentry-cocoa, beforeSend is not called before captureEnvelope
options.beforeSend = { event in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:sentry/sentry.dart';

class FlutterExceptionEventProcessor implements EventProcessor {
@override
SentryEvent apply(SentryEvent event, {dynamic hint}) {
SentryEvent apply(SentryEvent event, {Hint? hint}) {
final exception = event.throwable;
if (exception is NetworkImageLoadException) {
return _applyNetworkImageLoadException(event, exception);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class NativeAppStartEventProcessor extends EventProcessor {
final SentryNative _native;

@override
FutureOr<SentryEvent?> apply(SentryEvent event, {hint}) async {
FutureOr<SentryEvent?> apply(SentryEvent event, {Hint? hint}) async {
final appStartEnd = _native.appStartEnd;

if (appStartEnd != null &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ScreenshotEventProcessor extends EventProcessor {
sentryScreenshotWidgetGlobalKey.currentContext != null;

@override
FutureOr<SentryEvent?> apply(SentryEvent event, {hint}) async {
FutureOr<SentryEvent?> apply(SentryEvent event, {Hint? hint}) async {
if (event.exceptions == null &&
event.throwable == null &&
_hasSentryScreenshotWidget) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class _LoadContextsIntegrationEventProcessor extends EventProcessor {
final SentryFlutterOptions _options;

@override
FutureOr<SentryEvent?> apply(SentryEvent event, {hint}) async {
FutureOr<SentryEvent?> apply(SentryEvent event, {Hint? hint}) async {
try {
final loadContexts = await _channel.invokeMethod('loadContexts');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class _LoadImageListIntegrationEventProcessor extends EventProcessor {
final SentryFlutterOptions _options;

@override
FutureOr<SentryEvent?> apply(SentryEvent event, {hint}) async {
FutureOr<SentryEvent?> apply(SentryEvent event, {Hint? hint}) async {
if (event.needsSymbolication()) {
try {
// we call on every event because the loaded image list is cached
Expand Down
2 changes: 1 addition & 1 deletion metrics/flutter.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = 3.7.6
version = 3.7.7
repo = https://github.com/flutter/flutter

0 comments on commit 7aff6ac

Please sign in to comment.