Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

4780 switch off private mode #5614

Merged

Conversation

severinrudie
Copy link
Contributor

@severinrudie severinrudie commented Sep 26, 2019

Pull Request checklist

  • Quality: This PR builds and passes detekt/ktlint checks (A pre-push hook is recommended)
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not
    Doesn't change the UI
  • Accessibility: The code in this PR follows accessibility best practices or does not include any user facing features

After merge

  • Milestone: Make sure issues finished by this pull request are added to the milestone of the version currently in development.

To download an APK when reviewing a PR:

  1. click on Show All Checks,
  2. click Details next to "Taskcluster (pull_request)" after it appears and then finishes with a green checkmark,
  3. click on the "Fenix - assemble" task, then click "Run Artifacts".
  4. the APK links should be on the left side of the screen, named for each CPU architecture

@severinrudie severinrudie marked this pull request as ready for review September 26, 2019 22:52
@codecov-io
Copy link

codecov-io commented Sep 26, 2019

Codecov Report

Merging #5614 into master will increase coverage by <.01%.
The diff coverage is 25%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #5614      +/-   ##
============================================
+ Coverage     14.46%   14.46%   +<.01%     
- Complexity      322      325       +3     
============================================
  Files           255      255              
  Lines         10490    10517      +27     
  Branches       1526     1536      +10     
============================================
+ Hits           1517     1521       +4     
- Misses         8851     8873      +22     
- Partials        122      123       +1
Impacted Files Coverage Δ Complexity Δ
.../src/main/java/org/mozilla/fenix/utils/Settings.kt 72.25% <ø> (ø) 15 <0> (ø) ⬇️
...ozilla/fenix/session/SessionNotificationService.kt 0% <0%> (ø) 0 <0> (ø) ⬇️
...rc/main/java/org/mozilla/fenix/FenixApplication.kt 4.5% <33.33%> (+0.8%) 4 <2> (+2) ⬆️
...deletebrowsingdata/DeleteBrowsingDataController.kt 79.31% <0%> (-8.69%) 0% <0%> (ø)
...s/deletebrowsingdata/DeleteBrowsingDataFragment.kt 0% <0%> (ø) 0% <0%> (ø) ⬇️
...ava/org/mozilla/fenix/settings/SettingsFragment.kt 0% <0%> (ø) 0% <0%> (ø) ⬇️
...pp/src/main/java/org/mozilla/fenix/FeatureFlags.kt 90.9% <0%> (+2.02%) 3% <0%> (+1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2896b36...112410e. Read the comment docs.

@sblatz sblatz self-assigned this Sep 27, 2019
@severinrudie severinrudie force-pushed the 4780-switch-off-private-mode branch 2 times, most recently from d2b8481 to a8246e5 Compare September 27, 2019 20:49
Copy link
Contributor

@sblatz sblatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to be working for me:

issue 2019-10-01 08_03_18

fun maybeClearPrivateMode(settings: Settings = settings()) {
// This needs to be called before the theme is set. No BrowsingModeManager is available
// at this point, which is why this is set directly
if (!settings.alwaysOpenInPrivateMode) settings.usePrivateMode = false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alwaysOpenInPrivateMode is actually a misleading variable name. I'm submitting a patch right now to change it, but currently it controls "launch links in a private tab."

I don't think we actually want to stop the user from opening in normal mode because of this pref.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@severinrudie
Copy link
Contributor Author

This doesn't seem to be working for me:

To clarify, there are two flows here.

Flow 1 (working as expected)

STR:

  • Open FF
  • Set private mode
  • Kill FF
  • Reopen

Expected:

  • FF opens in normal mode

Actual:

  • FF opens in normal mode

Flow 2 (failing)

STR:

  • Open FF
  • Set private mode
  • Navigate to any website
  • Kill FF
  • Reopen

Expected:

  • No tabs are open
  • FF opens in normal mode

Actual:

  • No tabs are open
  • FF opens in private mode

I'm working on a fix

@severinrudie
Copy link
Contributor Author

It looks like the application is not being destroyed if the app is force killed while a private tab is opened. Checked by running adb shell ps | grep org.mozilla.fenix after force killing with and without private tabs open.

Seems to be related to the private tab notification. I commented out this notification, and the app was killed as expected.

rushsteve1 and others added 2 commits October 2, 2019 10:05
When the app launches do not launch in Private Mode in order to prevent usage leaks to other users of the device.
@severinrudie
Copy link
Contributor Author

@sblatz: @ boek suggested storing usePrivateMode in memory as an alternative to this approach. I think that's a really great suggestion, but until we work out why the application is not being destroyed when the notification service is, it won't solve that edge case. I haven't worked out a approach than this in the meantime, and I don't think it's worth spending more time on it.

Copy link
Contributor

@sblatz sblatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good now 😄

@sblatz sblatz merged commit 3be0695 into mozilla-mobile:master Oct 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants