Skip to content

release/11.14.0 #390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ commands:
setup_flutter:
steps:
- flutter/install_sdk_and_pub:
flutter_version: 3.3.0
flutter_version: 3.10.5
- run:
name: Generate Pigeons
command: sh ./scripts/pigeon.sh
Expand All @@ -33,7 +33,7 @@ commands:
steps:
- run:
name: Install Appium
command: npm install -g appium@next
command: npm install -g appium
- when:
condition:
equal:
Expand All @@ -42,7 +42,7 @@ commands:
steps:
- run:
name: Install XCUITest Driver
command: appium driver install xcuitest
command: appium driver install xcuitest@4.35.0
- when:
condition:
equal:
Expand All @@ -51,7 +51,7 @@ commands:
steps:
- run:
name: Install UIAutomator2 Driver
command: appium driver install uiautomator2
command: appium driver install uiautomator2@2.29.5
- run:
name: Launch Appium
# Enable --relaxed-security for `mobile: shell` command that Captain uses internally.
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## [11.14.0](https://github.com/Instabug/Instabug-Flutter/compare/v11.13.0...v11.14.0) (September 13, 2023)

### Added

- Add network logs obfuscation support using the new `NetworkLogger.obfuscateLog` API ([#380](https://github.com/Instabug/Instabug-Flutter/pull/380)).
- Add network logs omission support using the new `NetworkLogger.omitLog` API ([#382](https://github.com/Instabug/Instabug-Flutter/pull/382)).
- Add the new repro steps configuration API `Instabug.setReproStepsConfig` ([#388](https://github.com/Instabug/Instabug-Flutter/pull/388)).

### Changed

- 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).
- 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).

### Deprecated

- Deprecate `Instabug.setReproStepsMode` in favor of the new `Instabug.setReproStepsConfig` ([#388](https://github.com/Instabug/Instabug-Flutter/pull/388)).

## [11.13.0](https://github.com/Instabug/Instabug-Flutter/compare/v11.12.0...v11.13.0) (July 10, 2023)

### Changed
Expand Down
2 changes: 0 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
source "https://rubygems.org"

gem 'danger', '~> 8.6', '>= 8.6.1'
73 changes: 0 additions & 73 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,84 +1,11 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.1)
public_suffix (>= 2.0.2, < 6.0)
claide (1.1.0)
claide-plugins (0.9.2)
cork
nap
open4 (~> 1.3)
colored2 (3.1.2)
cork (0.3.0)
colored2 (~> 3.1)
danger (8.6.1)
claide (~> 1.0)
claide-plugins (>= 0.9.2)
colored2 (~> 3.1)
cork (~> 0.1)
faraday (>= 0.9.0, < 2.0)
faraday-http-cache (~> 2.0)
git (~> 1.7)
kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.0)
no_proxy_fix
octokit (~> 4.7)
terminal-table (>= 1, < 4)
faraday (1.10.2)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-httpclient (~> 1.0)
faraday-multipart (~> 1.0)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.0)
faraday-patron (~> 1.0)
faraday-rack (~> 1.0)
faraday-retry (~> 1.0)
ruby2_keywords (>= 0.0.4)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-http-cache (2.4.1)
faraday (>= 0.8)
faraday-httpclient (1.0.1)
faraday-multipart (1.0.4)
multipart-post (~> 2)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.3)
git (1.12.0)
addressable (~> 2.8)
rchardet (~> 1.8)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
multipart-post (2.2.3)
nap (1.1.0)
no_proxy_fix (0.1.2)
octokit (4.25.1)
faraday (>= 1, < 3)
sawyer (~> 0.9)
open4 (1.3.4)
public_suffix (5.0.0)
rchardet (1.8.0)
rexml (3.2.5)
ruby2_keywords (0.0.5)
sawyer (0.9.2)
addressable (>= 2.3.5)
faraday (>= 0.17.3, < 3)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
unicode-display_width (2.3.0)

PLATFORMS
ruby

DEPENDENCIES
danger (~> 8.6, >= 8.6.1)

BUNDLED WITH
1.17.2
29 changes: 16 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ A Flutter plugin for [Instabug](https://instabug.com/).

### Installation


1. Add Instabug to your `pubspec.yaml` file.

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

```dart
void main() {
WidgetsFlutterBinding.ensureInitialized();

Instabug.init(
token: 'APP_TOKEN',
invocationEvents: [InvocationEvent.floatingButton],
runZonedGuarded(
() {
WidgetsFlutterBinding.ensureInitialized();

Instabug.init(
token: 'APP_TOKEN',
invocationEvents: [InvocationEvent.shake],
);

FlutterError.onError = (FlutterErrorDetails details) {
Zone.current.handleUncaughtError(details.exception, details.stack!);
};

runApp(MyApp());
},
CrashReporting.reportCrash,
);

FlutterError.onError = (FlutterErrorDetails details) {
Zone.current.handleUncaughtError(details.exception, details.stack!);
};

runZonedGuarded(() => runApp(MyApp()), CrashReporting.reportCrash);
}
```

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


## Network Logging
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.

Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group 'com.instabug.flutter'
version '11.13.0'
version '11.14.0'

buildscript {
repositories {
Expand Down Expand Up @@ -41,7 +41,7 @@ android {
}

dependencies {
api 'com.instabug.library:instabug:11.13.0'
api 'com.instabug.library:instabug:11.14.0'

testImplementation 'junit:junit:4.13.2'
testImplementation "org.mockito:mockito-inline:3.12.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
import com.instabug.library.Instabug;
import com.instabug.library.InstabugColorTheme;
import com.instabug.library.InstabugCustomTextPlaceHolder;
import com.instabug.library.IssueType;
import com.instabug.library.Platform;
import com.instabug.library.ReproConfigurations;
import com.instabug.library.internal.module.InstabugLocale;
import com.instabug.library.invocation.InstabugInvocationEvent;
import com.instabug.library.model.NetworkLog;
Expand Down Expand Up @@ -283,7 +285,9 @@ public void setSdkDebugLogsLevel(@NonNull String level) {
// iOS Only
}

@SuppressWarnings("deprecation")
@Override
@Deprecated()
public void setReproStepsMode(@NonNull String mode) {
try {
final State resolvedMode = ArgsRegistry.reproStates.get(mode);
Expand All @@ -293,6 +297,29 @@ public void setReproStepsMode(@NonNull String mode) {
}
}

@Override
public void setReproStepsConfig(@Nullable String bugMode, @Nullable String crashMode) {
try {
final ReproConfigurations.Builder builder = new ReproConfigurations.Builder();

if (bugMode != null) {
final Integer resolvedBugMode = ArgsRegistry.reproModes.get(bugMode);
builder.setIssueMode(IssueType.Bug, resolvedBugMode);
}

if (crashMode != null) {
final Integer resolvedCrashMode = ArgsRegistry.reproModes.get(crashMode);
builder.setIssueMode(IssueType.Crash, resolvedCrashMode);
}

final ReproConfigurations config = builder.build();

Instabug.setReproConfigurations(config);
} catch (Exception e) {
e.printStackTrace();
}
}

@Override
public void reportScreenChange(@NonNull String screenName) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.instabug.library.InstabugColorTheme;
import com.instabug.library.InstabugCustomTextPlaceHolder.Key;
import com.instabug.library.OnSdkDismissCallback.DismissType;
import com.instabug.library.ReproMode;
import com.instabug.library.extendedbugreport.ExtendedBugReport;
import com.instabug.library.internal.module.InstabugLocale;
import com.instabug.library.invocation.InstabugInvocationEvent;
Expand Down Expand Up @@ -111,12 +112,19 @@ public T get(Object key) {
put("ExtendedBugReportMode.disabled", ExtendedBugReport.State.DISABLED);
}};

@Deprecated()
public static final ArgsMap<State> reproStates = new ArgsMap<State>() {{
put("ReproStepsMode.enabledWithNoScreenshots", State.ENABLED_WITH_NO_SCREENSHOTS);
put("ReproStepsMode.enabled", State.ENABLED);
put("ReproStepsMode.disabled", State.DISABLED);
}};

public static final ArgsMap<Integer> reproModes = new ArgsMap<Integer>() {{
put("ReproStepsMode.enabledWithNoScreenshots", ReproMode.EnableWithNoScreenshots);
put("ReproStepsMode.enabled", ReproMode.EnableWithScreenshots);
put("ReproStepsMode.disabled", ReproMode.Disable);
}};

public static final ArgsMap<InstabugLocale> locales = new ArgsMap<InstabugLocale>() {{
put("IBGLocale.arabic", InstabugLocale.ARABIC);
put("IBGLocale.azerbaijani", InstabugLocale.AZERBAIJANI);
Expand Down Expand Up @@ -214,4 +222,4 @@ public T get(Object key) {
put("CustomTextPlaceHolderKey.messagesNotificationAndOthers", Key.CHATS_MULTIPLE_MESSAGE_NOTIFICATION);
put("CustomTextPlaceHolderKey.insufficientContentMessage", Key.COMMENT_FIELD_INSUFFICIENT_CONTENT);
}};
}
}
15 changes: 15 additions & 0 deletions android/src/test/java/com/instabug/flutter/ArgsRegistryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.instabug.library.InstabugColorTheme;
import com.instabug.library.InstabugCustomTextPlaceHolder.Key;
import com.instabug.library.OnSdkDismissCallback.DismissType;
import com.instabug.library.ReproMode;
import com.instabug.library.extendedbugreport.ExtendedBugReport;
import com.instabug.library.internal.module.InstabugLocale;
import com.instabug.library.invocation.InstabugInvocationEvent;
Expand Down Expand Up @@ -183,6 +184,7 @@ public void testExtendedBugReportStates() {
}


@SuppressWarnings("deprecation")
@Test
public void testReproStates() {
State[] values = {
Expand All @@ -196,6 +198,19 @@ public void testReproStates() {
}
}

@Test
public void testReproModes() {
Integer[] values = {
ReproMode.Disable,
ReproMode.EnableWithScreenshots,
ReproMode.EnableWithNoScreenshots,
};

for (Integer value : values) {
assertTrue(ArgsRegistry.reproModes.containsValue(value));
}
}


@Test
public void testLocales() {
Expand Down
27 changes: 27 additions & 0 deletions android/src/test/java/com/instabug/flutter/InstabugApiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.argThat;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
Expand All @@ -30,8 +31,11 @@
import com.instabug.library.Instabug;
import com.instabug.library.InstabugColorTheme;
import com.instabug.library.InstabugCustomTextPlaceHolder;
import com.instabug.library.IssueType;
import com.instabug.library.LogLevel;
import com.instabug.library.Platform;
import com.instabug.library.ReproConfigurations;
import com.instabug.library.ReproMode;
import com.instabug.library.invocation.InstabugInvocationEvent;
import com.instabug.library.model.NetworkLog;
import com.instabug.library.ui.onboarding.WelcomeMessage;
Expand Down Expand Up @@ -383,6 +387,7 @@ public void testSetDebugEnabled() {
mInstabug.verify(() -> Instabug.setDebugEnabled(isEnabled));
}

@SuppressWarnings("deprecation")
@Test
public void testSetReproStepsMode() {
String mode = "ReproStepsMode.enabled";
Expand All @@ -392,6 +397,28 @@ public void testSetReproStepsMode() {
mInstabug.verify(() -> Instabug.setReproStepsState(State.ENABLED));
}

@Test
public void testSetReproStepsConfig() {
String bug = "ReproStepsMode.enabled";
String crash = "ReproStepsMode.disabled";

ReproConfigurations config = mock(ReproConfigurations.class);
MockedConstruction<ReproConfigurations.Builder> mReproConfigurationsBuilder = mockConstruction(ReproConfigurations.Builder.class, (mock, context) -> {
when(mock.setIssueMode(anyInt(), anyInt())).thenReturn(mock);
when(mock.build()).thenReturn(config);
});

api.setReproStepsConfig(bug, crash);

ReproConfigurations.Builder builder = mReproConfigurationsBuilder.constructed().get(0);

verify(builder).setIssueMode(IssueType.Bug, ReproMode.EnableWithScreenshots);
verify(builder).setIssueMode(IssueType.Crash, ReproMode.Disable);
verify(builder).build();

mInstabug.verify(() -> Instabug.setReproConfigurations(config));
}

@Test
public void testReportScreenChange() {
String screenName = "HomeScreen";
Expand Down
Loading