Skip to content

Commit 91f129e

Browse files
authored
Merge pull request #204 from Instabug/release/10.9.0
[MOB-5988] Release/10.9.0
2 parents a542b26 + b91e837 commit 91f129e

File tree

10 files changed

+73
-43
lines changed

10 files changed

+73
-43
lines changed

.circleci/config.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060

6161
flutter_tests:
6262
docker:
63-
- image: cirrusci/flutter:2.2.3
63+
- image: cirrusci/flutter
6464
steps:
6565
- checkout
6666
- run: sudo gem install bundler:1.16.1
@@ -73,6 +73,18 @@ jobs:
7373
- run: dartanalyzer --options analysis_options.yaml --fatal-warnings lib
7474
- run: flutter pub publish --dry-run
7575

76+
flutter_tests_2.2.3:
77+
docker:
78+
- image: cirrusci/flutter:2.2.3
79+
steps:
80+
- checkout
81+
- run: sudo gem install bundler:1.16.1
82+
- run: bundle check || sudo bundle install
83+
- run: bundle exec danger
84+
- run: flutter doctor
85+
- run: flutter packages get
86+
- run: flutter test --coverage
87+
7688
ios_tests:
7789
macos:
7890
xcode: "12.3.0"
@@ -128,12 +140,14 @@ workflows:
128140
build-test-and-approval-deploy:
129141
jobs:
130142
- flutter_tests
143+
- flutter_tests_2.2.3
131144
- android_tests
132145
- ios_tests
133146
- hold_pub_release:
134147
type: approval
135148
requires:
136149
- flutter_tests
150+
- flutter_tests_2.2.3
137151
- android_tests
138152
- ios_tests
139153
filters:
@@ -149,6 +163,7 @@ workflows:
149163
type: approval
150164
requires:
151165
- flutter_tests
166+
- flutter_tests_2.2.3
152167
- android_tests
153168
- ios_tests
154169
filters:

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ coverage/
3636
**/android/**/gradle-wrapper.jar
3737
**/android/.gradle
3838
**/android/captures/
39-
**/android/gradlew
40-
**/android/gradlew.bat
39+
android/gradlew
40+
android/gradlew.bat
4141
**/android/local.properties
4242
**/android/**/GeneratedPluginRegistrant.java
4343

@@ -74,4 +74,4 @@ coverage/
7474
!**/ios/**/default.mode2v3
7575
!**/ios/**/default.pbxuser
7676
!**/ios/**/default.perspectivev3
77-
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
77+
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
## v10.9.0 (2021-09-28)
2+
3+
* Migrates to Flutter Android embedding v2
4+
* Bumps Instabug native SDKs to v10.9
5+
16
## v10.8.0 (2021-09-13)
27

38
* Introduces Instabug's new App Performance Monitoring (APM)
49

5-
610
## v10.0.1 (2021-08-25)
711

812
* Fixes an issue with http client logger.

android/src/main/java/com/instabug/instabugflutter/InstabugFlutterPlugin.java

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import android.os.Looper;
88
import android.util.Log;
99

10+
import androidx.annotation.NonNull;
11+
1012
import com.instabug.apm.APM;
1113
import com.instabug.apm.model.ExecutionTrace;
1214
import com.instabug.apm.networking.APMNetworkLogger;
@@ -48,6 +50,8 @@
4850
import java.util.Map;
4951
import com.instabug.library.Platform;
5052

53+
import io.flutter.embedding.engine.plugins.FlutterPlugin;
54+
import io.flutter.plugin.common.BinaryMessenger;
5155
import io.flutter.plugin.common.MethodCall;
5256
import io.flutter.plugin.common.MethodChannel;
5357
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
@@ -58,7 +62,7 @@
5862
/**
5963
* InstabugFlutterPlugin
6064
*/
61-
public class InstabugFlutterPlugin implements MethodCallHandler {
65+
public class InstabugFlutterPlugin implements MethodCallHandler, FlutterPlugin {
6266

6367
final public static String INVOCATION_EVENT_NONE = "InvocationEvent.none";
6468
final public static String INVOCATION_EVENT_SCREENSHOT = "InvocationEvent.screenshot";
@@ -75,7 +79,21 @@ public class InstabugFlutterPlugin implements MethodCallHandler {
7579
* Plugin registration.
7680
*/
7781
public static void registerWith(Registrar registrar) {
78-
channel = new MethodChannel(registrar.messenger(), "instabug_flutter");
82+
register(registrar.messenger());
83+
}
84+
85+
@Override
86+
public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) {
87+
register(binding.getBinaryMessenger());
88+
}
89+
90+
@Override
91+
public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) {
92+
93+
}
94+
95+
private static void register(BinaryMessenger messenger){
96+
channel = new MethodChannel(messenger, "instabug_flutter");
7997
channel.setMethodCallHandler(new InstabugFlutterPlugin());
8098
}
8199

@@ -1216,4 +1234,5 @@ public void disable() {
12161234
Instabug.disable();
12171235
}
12181236

1237+
12191238
}

example/ios/Podfile.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
PODS:
22
- Flutter (1.0.0)
3-
- Instabug (10.8.1)
3+
- Instabug (10.9.2)
44
- instabug_flutter (0.0.1):
55
- Flutter
6-
- Instabug (= 10.8.1)
6+
- Instabug (= 10.9.2)
77
- OCMock (3.6)
88

99
DEPENDENCIES:
@@ -23,11 +23,11 @@ EXTERNAL SOURCES:
2323
:path: ".symlinks/plugins/instabug_flutter/ios"
2424

2525
SPEC CHECKSUMS:
26-
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
27-
Instabug: 5f79efa78dddb8dcbf105d9ca3bd2cfab4079fe3
28-
instabug_flutter: ce6f7e43005678ceb3c9685f61e8d760ee784def
26+
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
27+
Instabug: 0162662ec77995286850cce17080752fab4417f2
28+
instabug_flutter: 6b5832241dd506faa404d02569369ce69b6d6c68
2929
OCMock: 5ea90566be239f179ba766fd9fbae5885040b992
3030

3131
PODFILE CHECKSUM: 082ec096394aa5e2e9254f7b7845847607911bda
3232

33-
COCOAPODS: 1.10.1
33+
COCOAPODS: 1.11.2

ios/instabug_flutter.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ A new flutter plugin project.
1515
s.source_files = 'Classes/**/*'
1616
s.public_header_files = 'Classes/**/*.h'
1717
s.dependency 'Flutter'
18-
s.dependency 'Instabug', '10.8.1'
18+
s.dependency 'Instabug', '10.9.2'
1919

2020
s.ios.deployment_target = '10.0'
2121
s.pod_target_xcconfig = { 'OTHER_LDFLAGS' => '-framework "Flutter" -framework "Instabug"'}

lib/instabug_custom_http_client.dart

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,14 @@ class InstabugCustomHttpClient extends HttpClientLogger implements HttpClient {
5656
client.addProxyCredentials(host, port, realm, credentials);
5757

5858
@override
59-
set authenticate(
60-
Future<bool> Function(Uri url, String scheme, String realm)? f) =>
61-
client.authenticate = f;
59+
set authenticate(f) {
60+
client.authenticate = f;
61+
}
6262

6363
@override
64-
set authenticateProxy(
65-
Future<bool> Function(
66-
String host, int port, String scheme, String realm)?
67-
f) =>
68-
client.authenticateProxy = f;
64+
set authenticateProxy(f) {
65+
client.authenticateProxy = f;
66+
}
6967

7068
@override
7169
set badCertificateCallback(
@@ -145,8 +143,7 @@ class InstabugCustomHttpClient extends HttpClientLogger implements HttpClient {
145143
Future<InstabugCustomHttpClientRequest> _finish(
146144
HttpClientRequest request) async {
147145
logger.onRequest(request);
148-
final customRequest =
149-
InstabugCustomHttpClientRequest(request, logger);
146+
final customRequest = InstabugCustomHttpClientRequest(request, logger);
150147
return customRequest;
151148
}
152149
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: instabug_flutter
2-
version: 10.8.0
2+
version: 10.9.0
33
description: >-
44
Deliver the best user experience through a comprehensive platform that will
55
help you uncover, analyze and fix any app performance, quality or stability issues.

test/instabug_flutter_test.dart

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ import 'package:instabug_flutter/InstabugLog.dart';
1616
import 'package:instabug_flutter/NetworkLogger.dart';
1717
import 'package:instabug_flutter/Replies.dart';
1818
import 'package:instabug_flutter/Surveys.dart';
19-
import 'package:instabug_flutter/instabug_custom_http_client.dart';
2019
import 'package:instabug_flutter/models/crash_data.dart';
2120
import 'package:instabug_flutter/models/exception_data.dart';
22-
import 'package:instabug_flutter/models/trace.dart' as execution_trace;
2321
import 'package:instabug_flutter/models/network_data.dart';
22+
import 'package:instabug_flutter/models/trace.dart' as execution_trace;
2423
import 'package:instabug_flutter/utils/platform_manager.dart';
2524
import 'package:mockito/annotations.dart';
2625
import 'package:mockito/mockito.dart';
@@ -32,6 +31,7 @@ import 'instabug_flutter_test.mocks.dart';
3231
PlatformManager,
3332
])
3433
void main() {
34+
TestWidgetsFlutterBinding.ensureInitialized();
3535
WidgetsFlutterBinding.ensureInitialized();
3636
final List<MethodCall> log = <MethodCall>[];
3737
const appToken = '068ba9a8c3615035e163dc5f829c73be';
@@ -996,16 +996,6 @@ void main() {
996996
expect(newNetworkData.status, statusCopy);
997997
});
998998

999-
test('Test Http client logger', () async {
1000-
final InstabugCustomHttpClient client = InstabugCustomHttpClient();
1001-
final HttpClientRequest request = await client
1002-
.getUrl(Uri.parse('https://jsonplaceholder.typicode.com/posts'));
1003-
client.logger.onRequest(request);
1004-
final HttpClientResponse response = await request.close();
1005-
client.logger.onResponse(response, request);
1006-
expect(client.requests.length, 0);
1007-
});
1008-
1009999
test('setAPMEnabled: Test', () async {
10101000
bool isEnabled = false;
10111001
final List<dynamic> args = <dynamic>[isEnabled];

test/network_logger_test.dart

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import 'network_logger_test.mocks.dart';
2020
HttpClientCredentials,
2121
])
2222
void main() {
23+
TestWidgetsFlutterBinding.ensureInitialized();
2324
WidgetsFlutterBinding.ensureInitialized();
2425

2526
final List<MethodCall> log = <MethodCall>[];
@@ -53,8 +54,9 @@ void main() {
5354
when(mockRequest.followRedirects).thenAnswer((_) => true);
5455
when(mockRequest.maxRedirects).thenAnswer((_) => 5);
5556
when(mockRequest.persistentConnection).thenAnswer((_) => true);
56-
57-
instabugCustomHttpClientRequest = InstabugCustomHttpClientRequest(mockRequest, instabugCustomHttpClient.logger);
57+
58+
instabugCustomHttpClientRequest = InstabugCustomHttpClientRequest(
59+
mockRequest, instabugCustomHttpClient.logger);
5860

5961
expect(mockRequest, isInstanceOf<HttpClientRequest>());
6062
expect(mockResponse, isInstanceOf<HttpClientResponse>());
@@ -393,8 +395,10 @@ void main() {
393395
test('expect instabug custom http client to set client authenticate',
394396
() async {
395397
final Future<bool> Function(Uri url, String scheme, String realm) f =
396-
(Uri url, String scheme, String realm) async => true;
397-
instabugCustomHttpClient.authenticate = f;
398+
(Uri url, String scheme, String? realm) async => true;
399+
400+
instabugCustomHttpClient.authenticate =
401+
f as Future<bool> Function(Uri url, String scheme, String? realm);
398402
verify((instabugCustomHttpClient.client as MockHttpClient).authenticate = f)
399403
.called(1);
400404
});
@@ -403,8 +407,9 @@ void main() {
403407
() async {
404408
final Future<bool> Function(
405409
String host, int port, String scheme, String realm) f =
406-
(String host, int port, String scheme, String realm) async => true;
407-
instabugCustomHttpClient.authenticateProxy = f;
410+
(String host, int port, String scheme, String? realm) async => true;
411+
instabugCustomHttpClient.authenticateProxy = f as Future<bool> Function(
412+
String host, int port, String scheme, String? realm);
408413
verify((instabugCustomHttpClient.client as MockHttpClient)
409414
.authenticateProxy = f)
410415
.called(1);

0 commit comments

Comments
 (0)