Skip to content

Commit 24d9e2a

Browse files
abdelhamid-f-nasserasamiza7medev
authored
release/11.14.0 (#390)
* [MOB-12516] Fix zone mismatch issue (#376) * fix(initialization): fix zone mismatch issue in initialization code * fix(initilization): fix the PR comments * [MOB-12700] Remove danger ruby package (#379) Remove danger ruby package to resolve dependabot git security vulnerability issue. * [MOB-12513] Fix Mockito and Pigeon Dependency Conflict (#377) * Unrestrict a specific Pigeon version * Unrestrict a specific Mockito version * Upgrade Flutter CI version with Mockito and Pigeon * Remove ask question button in example --------- Co-authored-by: Ahmed Mahmoud <[email protected]> * test: update captain config (#386) Jira ID: MOB-13002 * chore(ios): bump sdk to 11.14.0 (#383) Jira ID: MOB-12993 * feat: support network logs obfuscation (#380) Jira ID: MOB-12523 * feat: support network logs omission (#382) Jira ID: MOB-12524 * chore(android): bump sdk to 11.14.0 (#384) Jira ID: MOB-12992 * feat: add new repro steps api (#388) Jira ID: MOB-13005 * chore: update sdk version to v11.14.0 (#389) Jira ID: MOB-13014 --------- Co-authored-by: Ahmed Sami <[email protected]> Co-authored-by: Ahmed Mahmoud <[email protected]> Co-authored-by: Ahmed Mahmoud <[email protected]>
1 parent a03f9c4 commit 24d9e2a

32 files changed

+549
-164
lines changed

.circleci/config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ commands:
99
setup_flutter:
1010
steps:
1111
- flutter/install_sdk_and_pub:
12-
flutter_version: 3.3.0
12+
flutter_version: 3.10.5
1313
- run:
1414
name: Generate Pigeons
1515
command: sh ./scripts/pigeon.sh
@@ -33,7 +33,7 @@ commands:
3333
steps:
3434
- run:
3535
name: Install Appium
36-
command: npm install -g appium@next
36+
command: npm install -g appium
3737
- when:
3838
condition:
3939
equal:
@@ -42,7 +42,7 @@ commands:
4242
steps:
4343
- run:
4444
name: Install XCUITest Driver
45-
command: appium driver install xcuitest
45+
command: appium driver install xcuitest@4.35.0
4646
- when:
4747
condition:
4848
equal:
@@ -51,7 +51,7 @@ commands:
5151
steps:
5252
- run:
5353
name: Install UIAutomator2 Driver
54-
command: appium driver install uiautomator2
54+
command: appium driver install uiautomator2@2.29.5
5555
- run:
5656
name: Launch Appium
5757
# Enable --relaxed-security for `mobile: shell` command that Captain uses internally.

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Changelog
22

3+
## [11.14.0](https://github.com/Instabug/Instabug-Flutter/compare/v11.13.0...v11.14.0) (September 13, 2023)
4+
5+
### Added
6+
7+
- Add network logs obfuscation support using the new `NetworkLogger.obfuscateLog` API ([#380](https://github.com/Instabug/Instabug-Flutter/pull/380)).
8+
- Add network logs omission support using the new `NetworkLogger.omitLog` API ([#382](https://github.com/Instabug/Instabug-Flutter/pull/382)).
9+
- Add the new repro steps configuration API `Instabug.setReproStepsConfig` ([#388](https://github.com/Instabug/Instabug-Flutter/pull/388)).
10+
11+
### Changed
12+
13+
- Bump Instabug Android SDK to v11.14.0 ([#384](https://github.com/Instabug/Instabug-Flutter/pull/384)). [See release notes](https://github.com/Instabug/Instabug-Android/releases/tag/v11.14.0).
14+
- Bump Instabug iOS SDK to v11.14.0 ([#383](https://github.com/Instabug/Instabug-Flutter/pull/383)). [See release notes](https://github.com/Instabug/Instabug-iOS/releases/tag/11.14.0).
15+
16+
### Deprecated
17+
18+
- Deprecate `Instabug.setReproStepsMode` in favor of the new `Instabug.setReproStepsConfig` ([#388](https://github.com/Instabug/Instabug-Flutter/pull/388)).
19+
320
## [11.13.0](https://github.com/Instabug/Instabug-Flutter/compare/v11.12.0...v11.13.0) (July 10, 2023)
421

522
### Changed

Gemfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
source "https://rubygems.org"
2-
3-
gem 'danger', '~> 8.6', '>= 8.6.1'

Gemfile.lock

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,11 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
addressable (2.8.1)
5-
public_suffix (>= 2.0.2, < 6.0)
6-
claide (1.1.0)
7-
claide-plugins (0.9.2)
8-
cork
9-
nap
10-
open4 (~> 1.3)
11-
colored2 (3.1.2)
12-
cork (0.3.0)
13-
colored2 (~> 3.1)
14-
danger (8.6.1)
15-
claide (~> 1.0)
16-
claide-plugins (>= 0.9.2)
17-
colored2 (~> 3.1)
18-
cork (~> 0.1)
19-
faraday (>= 0.9.0, < 2.0)
20-
faraday-http-cache (~> 2.0)
21-
git (~> 1.7)
22-
kramdown (~> 2.3)
23-
kramdown-parser-gfm (~> 1.0)
24-
no_proxy_fix
25-
octokit (~> 4.7)
26-
terminal-table (>= 1, < 4)
27-
faraday (1.10.2)
28-
faraday-em_http (~> 1.0)
29-
faraday-em_synchrony (~> 1.0)
30-
faraday-excon (~> 1.1)
31-
faraday-httpclient (~> 1.0)
32-
faraday-multipart (~> 1.0)
33-
faraday-net_http (~> 1.0)
34-
faraday-net_http_persistent (~> 1.0)
35-
faraday-patron (~> 1.0)
36-
faraday-rack (~> 1.0)
37-
faraday-retry (~> 1.0)
38-
ruby2_keywords (>= 0.0.4)
39-
faraday-em_http (1.0.0)
40-
faraday-em_synchrony (1.0.0)
41-
faraday-excon (1.1.0)
42-
faraday-http-cache (2.4.1)
43-
faraday (>= 0.8)
44-
faraday-httpclient (1.0.1)
45-
faraday-multipart (1.0.4)
46-
multipart-post (~> 2)
47-
faraday-net_http (1.0.1)
48-
faraday-net_http_persistent (1.2.0)
49-
faraday-patron (1.0.0)
50-
faraday-rack (1.0.0)
51-
faraday-retry (1.0.3)
52-
git (1.12.0)
53-
addressable (~> 2.8)
54-
rchardet (~> 1.8)
55-
kramdown (2.4.0)
56-
rexml
57-
kramdown-parser-gfm (1.1.0)
58-
kramdown (~> 2.0)
59-
multipart-post (2.2.3)
60-
nap (1.1.0)
61-
no_proxy_fix (0.1.2)
62-
octokit (4.25.1)
63-
faraday (>= 1, < 3)
64-
sawyer (~> 0.9)
65-
open4 (1.3.4)
66-
public_suffix (5.0.0)
67-
rchardet (1.8.0)
68-
rexml (3.2.5)
69-
ruby2_keywords (0.0.5)
70-
sawyer (0.9.2)
71-
addressable (>= 2.3.5)
72-
faraday (>= 0.17.3, < 3)
73-
terminal-table (3.0.2)
74-
unicode-display_width (>= 1.1.1, < 3)
75-
unicode-display_width (2.3.0)
764

775
PLATFORMS
786
ruby
797

808
DEPENDENCIES
81-
danger (~> 8.6, >= 8.6.1)
829

8310
BUNDLED WITH
8411
1.17.2

README.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ A Flutter plugin for [Instabug](https://instabug.com/).
2222

2323
### Installation
2424

25-
2625
1. Add Instabug to your `pubspec.yaml` file.
2726

2827
```yaml
@@ -65,18 +64,23 @@ Instabug automatically captures every crash of your app and sends relevant detai
6564

6665
```dart
6766
void main() {
68-
WidgetsFlutterBinding.ensureInitialized();
69-
70-
Instabug.init(
71-
token: 'APP_TOKEN',
72-
invocationEvents: [InvocationEvent.floatingButton],
67+
runZonedGuarded(
68+
() {
69+
WidgetsFlutterBinding.ensureInitialized();
70+
71+
Instabug.init(
72+
token: 'APP_TOKEN',
73+
invocationEvents: [InvocationEvent.shake],
74+
);
75+
76+
FlutterError.onError = (FlutterErrorDetails details) {
77+
Zone.current.handleUncaughtError(details.exception, details.stack!);
78+
};
79+
80+
runApp(MyApp());
81+
},
82+
CrashReporting.reportCrash,
7383
);
74-
75-
FlutterError.onError = (FlutterErrorDetails details) {
76-
Zone.current.handleUncaughtError(details.exception, details.stack!);
77-
};
78-
79-
runZonedGuarded(() => runApp(MyApp()), CrashReporting.reportCrash);
8084
}
8185
```
8286

@@ -90,7 +94,6 @@ Repro Steps list all of the actions an app user took before reporting a bug or c
9094
));
9195
```
9296

93-
9497
## Network Logging
9598
You can choose to attach all your network requests to the reports being sent to the dashboard. To enable the feature when using the `dart:io` package `HttpClient`, please refer to the [Instabug Dart IO Http Client](https://github.com/Instabug/instabug-dart-io-http-client) repository.
9699

android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
group 'com.instabug.flutter'
2-
version '11.13.0'
2+
version '11.14.0'
33

44
buildscript {
55
repositories {
@@ -41,7 +41,7 @@ android {
4141
}
4242

4343
dependencies {
44-
api 'com.instabug.library:instabug:11.13.0'
44+
api 'com.instabug.library:instabug:11.14.0'
4545

4646
testImplementation 'junit:junit:4.13.2'
4747
testImplementation "org.mockito:mockito-inline:3.12.1"

android/src/main/java/com/instabug/flutter/modules/InstabugApi.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
import com.instabug.library.Instabug;
2020
import com.instabug.library.InstabugColorTheme;
2121
import com.instabug.library.InstabugCustomTextPlaceHolder;
22+
import com.instabug.library.IssueType;
2223
import com.instabug.library.Platform;
24+
import com.instabug.library.ReproConfigurations;
2325
import com.instabug.library.internal.module.InstabugLocale;
2426
import com.instabug.library.invocation.InstabugInvocationEvent;
2527
import com.instabug.library.model.NetworkLog;
@@ -283,7 +285,9 @@ public void setSdkDebugLogsLevel(@NonNull String level) {
283285
// iOS Only
284286
}
285287

288+
@SuppressWarnings("deprecation")
286289
@Override
290+
@Deprecated()
287291
public void setReproStepsMode(@NonNull String mode) {
288292
try {
289293
final State resolvedMode = ArgsRegistry.reproStates.get(mode);
@@ -293,6 +297,29 @@ public void setReproStepsMode(@NonNull String mode) {
293297
}
294298
}
295299

300+
@Override
301+
public void setReproStepsConfig(@Nullable String bugMode, @Nullable String crashMode) {
302+
try {
303+
final ReproConfigurations.Builder builder = new ReproConfigurations.Builder();
304+
305+
if (bugMode != null) {
306+
final Integer resolvedBugMode = ArgsRegistry.reproModes.get(bugMode);
307+
builder.setIssueMode(IssueType.Bug, resolvedBugMode);
308+
}
309+
310+
if (crashMode != null) {
311+
final Integer resolvedCrashMode = ArgsRegistry.reproModes.get(crashMode);
312+
builder.setIssueMode(IssueType.Crash, resolvedCrashMode);
313+
}
314+
315+
final ReproConfigurations config = builder.build();
316+
317+
Instabug.setReproConfigurations(config);
318+
} catch (Exception e) {
319+
e.printStackTrace();
320+
}
321+
}
322+
296323
@Override
297324
public void reportScreenChange(@NonNull String screenName) {
298325
try {

android/src/main/java/com/instabug/flutter/util/ArgsRegistry.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import com.instabug.library.InstabugColorTheme;
1010
import com.instabug.library.InstabugCustomTextPlaceHolder.Key;
1111
import com.instabug.library.OnSdkDismissCallback.DismissType;
12+
import com.instabug.library.ReproMode;
1213
import com.instabug.library.extendedbugreport.ExtendedBugReport;
1314
import com.instabug.library.internal.module.InstabugLocale;
1415
import com.instabug.library.invocation.InstabugInvocationEvent;
@@ -111,12 +112,19 @@ public T get(Object key) {
111112
put("ExtendedBugReportMode.disabled", ExtendedBugReport.State.DISABLED);
112113
}};
113114

115+
@Deprecated()
114116
public static final ArgsMap<State> reproStates = new ArgsMap<State>() {{
115117
put("ReproStepsMode.enabledWithNoScreenshots", State.ENABLED_WITH_NO_SCREENSHOTS);
116118
put("ReproStepsMode.enabled", State.ENABLED);
117119
put("ReproStepsMode.disabled", State.DISABLED);
118120
}};
119121

122+
public static final ArgsMap<Integer> reproModes = new ArgsMap<Integer>() {{
123+
put("ReproStepsMode.enabledWithNoScreenshots", ReproMode.EnableWithNoScreenshots);
124+
put("ReproStepsMode.enabled", ReproMode.EnableWithScreenshots);
125+
put("ReproStepsMode.disabled", ReproMode.Disable);
126+
}};
127+
120128
public static final ArgsMap<InstabugLocale> locales = new ArgsMap<InstabugLocale>() {{
121129
put("IBGLocale.arabic", InstabugLocale.ARABIC);
122130
put("IBGLocale.azerbaijani", InstabugLocale.AZERBAIJANI);
@@ -214,4 +222,4 @@ public T get(Object key) {
214222
put("CustomTextPlaceHolderKey.messagesNotificationAndOthers", Key.CHATS_MULTIPLE_MESSAGE_NOTIFICATION);
215223
put("CustomTextPlaceHolderKey.insufficientContentMessage", Key.COMMENT_FIELD_INSUFFICIENT_CONTENT);
216224
}};
217-
}
225+
}

android/src/test/java/com/instabug/flutter/ArgsRegistryTest.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import com.instabug.library.InstabugColorTheme;
1111
import com.instabug.library.InstabugCustomTextPlaceHolder.Key;
1212
import com.instabug.library.OnSdkDismissCallback.DismissType;
13+
import com.instabug.library.ReproMode;
1314
import com.instabug.library.extendedbugreport.ExtendedBugReport;
1415
import com.instabug.library.internal.module.InstabugLocale;
1516
import com.instabug.library.invocation.InstabugInvocationEvent;
@@ -183,6 +184,7 @@ public void testExtendedBugReportStates() {
183184
}
184185

185186

187+
@SuppressWarnings("deprecation")
186188
@Test
187189
public void testReproStates() {
188190
State[] values = {
@@ -196,6 +198,19 @@ public void testReproStates() {
196198
}
197199
}
198200

201+
@Test
202+
public void testReproModes() {
203+
Integer[] values = {
204+
ReproMode.Disable,
205+
ReproMode.EnableWithScreenshots,
206+
ReproMode.EnableWithNoScreenshots,
207+
};
208+
209+
for (Integer value : values) {
210+
assertTrue(ArgsRegistry.reproModes.containsValue(value));
211+
}
212+
}
213+
199214

200215
@Test
201216
public void testLocales() {

android/src/test/java/com/instabug/flutter/InstabugApiTest.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import static org.mockito.ArgumentMatchers.any;
88
import static org.mockito.ArgumentMatchers.anyInt;
99
import static org.mockito.ArgumentMatchers.anyString;
10+
import static org.mockito.ArgumentMatchers.argThat;
1011
import static org.mockito.ArgumentMatchers.eq;
1112
import static org.mockito.Mockito.doReturn;
1213
import static org.mockito.Mockito.mock;
@@ -30,8 +31,11 @@
3031
import com.instabug.library.Instabug;
3132
import com.instabug.library.InstabugColorTheme;
3233
import com.instabug.library.InstabugCustomTextPlaceHolder;
34+
import com.instabug.library.IssueType;
3335
import com.instabug.library.LogLevel;
3436
import com.instabug.library.Platform;
37+
import com.instabug.library.ReproConfigurations;
38+
import com.instabug.library.ReproMode;
3539
import com.instabug.library.invocation.InstabugInvocationEvent;
3640
import com.instabug.library.model.NetworkLog;
3741
import com.instabug.library.ui.onboarding.WelcomeMessage;
@@ -383,6 +387,7 @@ public void testSetDebugEnabled() {
383387
mInstabug.verify(() -> Instabug.setDebugEnabled(isEnabled));
384388
}
385389

390+
@SuppressWarnings("deprecation")
386391
@Test
387392
public void testSetReproStepsMode() {
388393
String mode = "ReproStepsMode.enabled";
@@ -392,6 +397,28 @@ public void testSetReproStepsMode() {
392397
mInstabug.verify(() -> Instabug.setReproStepsState(State.ENABLED));
393398
}
394399

400+
@Test
401+
public void testSetReproStepsConfig() {
402+
String bug = "ReproStepsMode.enabled";
403+
String crash = "ReproStepsMode.disabled";
404+
405+
ReproConfigurations config = mock(ReproConfigurations.class);
406+
MockedConstruction<ReproConfigurations.Builder> mReproConfigurationsBuilder = mockConstruction(ReproConfigurations.Builder.class, (mock, context) -> {
407+
when(mock.setIssueMode(anyInt(), anyInt())).thenReturn(mock);
408+
when(mock.build()).thenReturn(config);
409+
});
410+
411+
api.setReproStepsConfig(bug, crash);
412+
413+
ReproConfigurations.Builder builder = mReproConfigurationsBuilder.constructed().get(0);
414+
415+
verify(builder).setIssueMode(IssueType.Bug, ReproMode.EnableWithScreenshots);
416+
verify(builder).setIssueMode(IssueType.Crash, ReproMode.Disable);
417+
verify(builder).build();
418+
419+
mInstabug.verify(() -> Instabug.setReproConfigurations(config));
420+
}
421+
395422
@Test
396423
public void testReportScreenChange() {
397424
String screenName = "HomeScreen";

0 commit comments

Comments
 (0)