[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Make sure daily recurring tasks are executed when MainActivi...

2016-10-13 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Make sure daily recurring tasks are executed when MainActivity 
is run.
..


Make sure daily recurring tasks are executed when MainActivity is run.

Right now our recurring tasks are triggered only when PageActivity is
started, which was acceptable in the previous incarnation of the app.
However, we now have MainActivity, with which the user can interact
without ever launching PageActivity, meaning that the recurring tasks
might not get executed.

This can actually mess with our engagement/retention metrics, since one of
the recurring tasks is DailyEventTask, which sends an event that we use to
measure retention.

This patch moves the execution of recurring tasks to the base activity
class, so that the tasks are executed when *any* of our activities is
started, not just PageActivity.

Change-Id: Ic9d41817740a65aac4ade0840efe784b32603b87
---
M app/src/main/java/org/wikipedia/activity/ThemedActionBarActivity.java
M app/src/main/java/org/wikipedia/page/PageActivity.java
2 files changed, 4 insertions(+), 4 deletions(-)

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



diff --git 
a/app/src/main/java/org/wikipedia/activity/ThemedActionBarActivity.java 
b/app/src/main/java/org/wikipedia/activity/ThemedActionBarActivity.java
index 776b349..0135bea 100644
--- a/app/src/main/java/org/wikipedia/activity/ThemedActionBarActivity.java
+++ b/app/src/main/java/org/wikipedia/activity/ThemedActionBarActivity.java
@@ -13,6 +13,7 @@
 import org.wikipedia.R;
 import org.wikipedia.WikipediaApp;
 import org.wikipedia.auth.AccountUtil;
+import org.wikipedia.recurring.RecurringTasksExecutor;
 import org.wikipedia.settings.Prefs;
 
 import java.lang.reflect.Field;
@@ -33,6 +34,9 @@
 getSupportActionBar().setDisplayHomeAsUpEnabled(true);
 }
 forceOverflowMenuIcon(this);
+
+// Conditionally execute all recurring tasks
+new RecurringTasksExecutor(WikipediaApp.getInstance()).run();
 }
 
 @Override
diff --git a/app/src/main/java/org/wikipedia/page/PageActivity.java 
b/app/src/main/java/org/wikipedia/page/PageActivity.java
index f702af3..458dcc5 100644
--- a/app/src/main/java/org/wikipedia/page/PageActivity.java
+++ b/app/src/main/java/org/wikipedia/page/PageActivity.java
@@ -58,7 +58,6 @@
 import org.wikipedia.page.tabs.TabsProvider;
 import org.wikipedia.page.tabs.TabsProvider.TabPosition;
 import org.wikipedia.readinglist.AddToReadingListDialog;
-import org.wikipedia.recurring.RecurringTasksExecutor;
 import org.wikipedia.search.SearchFragment;
 import org.wikipedia.search.SearchInvokeSource;
 import org.wikipedia.search.SearchResultsFragment;
@@ -183,9 +182,6 @@
 // then we must have been launched with an Intent, so... handle it!
 handleIntent(getIntent());
 }
-
-// Conditionally execute all recurring tasks
-new RecurringTasksExecutor(app).run();
 
 UserOptionContentResolver.requestManualSync();
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic9d41817740a65aac4ade0840efe784b32603b87
Gerrit-PatchSet: 3
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant 
Gerrit-Reviewer: BearND 
Gerrit-Reviewer: Brion VIBBER 
Gerrit-Reviewer: Mholloway 
Gerrit-Reviewer: Niedzielski 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] apps...wikipedia[master]: Make sure daily recurring tasks are executed when MainActivi...

2016-10-13 Thread Dbrant (Code Review)
Dbrant has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/315686

Change subject: Make sure daily recurring tasks are executed when MainActivity 
is run.
..

Make sure daily recurring tasks are executed when MainActivity is run.

Right now our recurring tasks are triggered only when PageActivity is
started, which was acceptable in the previous incarnation of the app.
However, we now have MainActivity, with which the user can interact
without ever launching PageActivity, meaning that the recurring tasks
might not get executed.

This can actually mess with our engagement/retention metrics, since one of
the recurring tasks is DailyEventTask, which sends an event that we use to
measure retention.

This patch ensures that these tasks are executed when MainActivity is
started, in addition to PageActivity.

Change-Id: Ic9d41817740a65aac4ade0840efe784b32603b87
---
M app/src/main/java/org/wikipedia/main/MainFragment.java
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/86/315686/1

diff --git a/app/src/main/java/org/wikipedia/main/MainFragment.java 
b/app/src/main/java/org/wikipedia/main/MainFragment.java
index fe23388..90f314d 100644
--- a/app/src/main/java/org/wikipedia/main/MainFragment.java
+++ b/app/src/main/java/org/wikipedia/main/MainFragment.java
@@ -46,6 +46,7 @@
 import org.wikipedia.page.linkpreview.LinkPreviewDialog;
 import org.wikipedia.readinglist.AddToReadingListDialog;
 import org.wikipedia.readinglist.ReadingListsFragment;
+import org.wikipedia.recurring.RecurringTasksExecutor;
 import org.wikipedia.search.SearchFragment;
 import org.wikipedia.search.SearchInvokeSource;
 import org.wikipedia.search.SearchResultsFragment;
@@ -107,6 +108,10 @@
 if (savedInstanceState == null) {
 handleIntent(getActivity().getIntent());
 }
+
+// Conditionally execute all recurring tasks
+new RecurringTasksExecutor(WikipediaApp.getInstance()).run();
+
 return view;
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic9d41817740a65aac4ade0840efe784b32603b87
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits