Skip to content

Commit

Permalink
fix(config): reset persistUser default value to true
Browse files Browse the repository at this point in the history
  • Loading branch information
YYChen01988 committed Jul 13, 2023
1 parent fd2b155 commit ba0790e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
* Added `Session.apiKey` so that it can be changed in an `OnSessionCallback`
[#1855](https://github.com/bugsnag/bugsnag-android/pull/1855)

* Configuration.persistUser is now true by default, matching the configuration of other platforms.
[#1863](https://github.com/bugsnag/bugsnag-android/pull/1863)

### Bug fixes

* Prevent rare app crash while migrating old `SharedPreferences` data from older versions of `bugsnag-android`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ManifestConfigLoaderTest {
assertTrue(autoDetectErrors)
assertTrue(autoTrackSessions)
assertEquals(ThreadSendPolicy.ALWAYS, sendThreads)
assertFalse(persistUser)
assertTrue(persistUser)

// endpoints
assertEquals(endpoints.notify, "https://notify.bugsnag.com")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ internal class ConfigInternal(
var versionCode: Int? = 0
var releaseStage: String? = null
var sendThreads: ThreadSendPolicy = ThreadSendPolicy.ALWAYS
var persistUser: Boolean = false
var persistUser: Boolean = true

var launchDurationMillis: Long = DEFAULT_LAUNCH_CRASH_THRESHOLD_MS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ public void sendThreadsInvalid() {

@Test
public void persistUserValid() {
config.setPersistUser(true);
assertTrue(config.impl.getPersistUser());
config.setPersistUser(false);
assertFalse(config.impl.getPersistUser());
}

@SuppressWarnings("deprecation")
Expand Down
1 change: 1 addition & 0 deletions features/full_tests/in_foreground.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Feature: In foreground field populates correctly
Background:
Given I clear all persistent data

@skip_android_13
Scenario: Test handled exception in background
When I run "InForegroundScenario"
And I send the app to the background for 5 seconds
Expand Down
1 change: 1 addition & 0 deletions features/full_tests/native_event_tracking.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Feature: Synchronizing app/device metadata in the native layer
And the event "unhandled" is false
And the "codeIdentifier" of stack frame 0 is not null

@skip
Scenario: Capture foreground state while in the background
When I run "CXXBackgroundNotifyScenario"
And I send the app to the background for 5 seconds
Expand Down

0 comments on commit ba0790e

Please sign in to comment.