jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/366856 )

Change subject: Fix infinite theme change loop in PageActivity.
......................................................................


Fix infinite theme change loop in PageActivity.

When changing the theme in PageActivity (while online) it enters an
infinite loop of light/dark theme changes.  This is because of a race
condition between the UserOption uploader uploading the new value and the
UserOption *downloader* downloading the previous value and triggering a
theme change to the old value.

This patch requests a sync of UserOptions only when the activity is
launched freshly (i.e. not restarted via theme change).

Bug: T170756
Change-Id: I830aef92c1c57dc64e42c49550a0b2fcb402534b
---
M app/src/main/java/org/wikipedia/page/PageActivity.java
1 file changed, 3 insertions(+), 3 deletions(-)

Approvals:
  jenkins-bot: Verified
  Mholloway: Looks good to me, approved



diff --git a/app/src/main/java/org/wikipedia/page/PageActivity.java 
b/app/src/main/java/org/wikipedia/page/PageActivity.java
index 14961e1..94f18c2 100644
--- a/app/src/main/java/org/wikipedia/page/PageActivity.java
+++ b/app/src/main/java/org/wikipedia/page/PageActivity.java
@@ -168,7 +168,7 @@
 
             // Note: when system language is enabled, and the system language 
is changed outside of
             // the app, MRU languages are not updated. There's no harm in 
doing that here but since
-            // the user didin't choose that language in app, it may be 
unexpected.
+            // the user didn't choose that language in app, it may be 
unexpected.
         }
 
         if (languageChanged) {
@@ -180,9 +180,9 @@
             // if there's no savedInstanceState, and we're not coming back 
from a Theme change,
             // then we must have been launched with an Intent, so... handle it!
             handleIntent(getIntent());
-        }
 
-        UserOptionContentResolver.requestManualSync();
+            UserOptionContentResolver.requestManualSync();
+        }
     }
 
     private void finishActionMode() {

-- 
To view, visit https://gerrit.wikimedia.org/r/366856
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I830aef92c1c57dc64e42c49550a0b2fcb402534b
Gerrit-PatchSet: 2
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant <[email protected]>
Gerrit-Reviewer: Brion VIBBER <[email protected]>
Gerrit-Reviewer: Dbrant <[email protected]>
Gerrit-Reviewer: Mholloway <[email protected]>
Gerrit-Reviewer: Niedzielski <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to