Commit 6ffb58a5 authored by Alexandre Frechette's avatar Alexandre Frechette Committed by Commit Bot

Send click actions right away, and persist actions for at least 2 days.

Bug: 1044196
Change-Id: Ie4a96b06ee8169bee76e07c79334cbc6d34a78aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2209345Reviewed-by: default avatarDan H <harringtond@chromium.org>
Commit-Queue: Alexandre Frechette <frechette@chromium.org>
Cr-Commit-Position: refs/heads/master@{#770318}
parent f8270017
...@@ -334,7 +334,7 @@ public class StreamActionApiImpl implements StreamActionApi { ...@@ -334,7 +334,7 @@ public class StreamActionApiImpl implements StreamActionApi {
@Override @Override
public void reportClickAction(String contentId, ActionPayload payload) { public void reportClickAction(String contentId, ActionPayload payload) {
if (ChromeFeatureList.isEnabled(ChromeFeatureList.REPORT_FEED_USER_ACTIONS)) { if (ChromeFeatureList.isEnabled(ChromeFeatureList.REPORT_FEED_USER_ACTIONS)) {
mActionManager.createAndStoreAction(contentId, payload); mActionManager.createAndUploadAction(contentId, payload);
} }
} }
......
...@@ -83,8 +83,8 @@ public final class FeedActionUploadRequestManager implements ActionUploadRequest ...@@ -83,8 +83,8 @@ public final class FeedActionUploadRequestManager implements ActionUploadRequest
ConfigKey.FEED_ACTION_SERVER_MAX_ACTIONS_PER_REQUEST, 10L); ConfigKey.FEED_ACTION_SERVER_MAX_ACTIONS_PER_REQUEST, 10L);
mMaxActionUploadAttempts = mMaxActionUploadAttempts =
configuration.getValueOrDefault(ConfigKey.FEED_ACTION_MAX_UPLOAD_ATTEMPTS, 1L); configuration.getValueOrDefault(ConfigKey.FEED_ACTION_MAX_UPLOAD_ATTEMPTS, 1L);
mMaxActionUploadTtl = mMaxActionUploadTtl = configuration.getValueOrDefault(
configuration.getValueOrDefault(ConfigKey.FEED_ACTION_TTL_SECONDS, 0L); ConfigKey.FEED_ACTION_TTL_SECONDS, TimeUnit.DAYS.toSeconds(2));
} }
@Override @Override
......
...@@ -297,7 +297,7 @@ public class StreamActionApiImplTest { ...@@ -297,7 +297,7 @@ public class StreamActionApiImplTest {
String contentId = "contentId"; String contentId = "contentId";
mStreamActionApi.reportClickAction(contentId, ACTION_PAYLOAD); mStreamActionApi.reportClickAction(contentId, ACTION_PAYLOAD);
verify(mActionManager).createAndStoreAction(contentId, ACTION_PAYLOAD); verify(mActionManager).createAndUploadAction(contentId, ACTION_PAYLOAD);
} }
@Test @Test
...@@ -305,7 +305,8 @@ public class StreamActionApiImplTest { ...@@ -305,7 +305,8 @@ public class StreamActionApiImplTest {
public void testNoReportClickAction_withoutFeature() { public void testNoReportClickAction_withoutFeature() {
mStreamActionApi.reportClickAction("contentId", ACTION_PAYLOAD); mStreamActionApi.reportClickAction("contentId", ACTION_PAYLOAD);
verify(mActionManager, never()).createAndStoreAction(anyString(), any(ActionPayload.class)); verify(mActionManager, never())
.createAndUploadAction(anyString(), any(ActionPayload.class));
} }
@Test @Test
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment