Title: [276545] trunk/Source/WebKit
Revision
276545
Author
katherine_che...@apple.com
Date
2021-04-23 17:47:50 -0700 (Fri, 23 Apr 2021)

Log Message

PCM: debug mode should send the second report on a 10 second delay after the first
https://bugs.webkit.org/show_bug.cgi?id=225010
<rdar://problem/77092303>

Reviewed by John Wilander.

Fix a bug in PCM debug mode where we don't set the timer for 10_s
after sending the first report for an attribution.

No new tests, this is debug mode only. Non-debug mode behavior is
covered by existing tests, and I tested debug mode manually.

* NetworkProcess/PrivateClickMeasurementManager.cpp:
(WebKit::PrivateClickMeasurementManager::firePendingAttributionRequests):
If the attribution has been sent to only one endpoint, indicated by
a non-null laterTimeToSend value, we should set the timer to be 10
seconds if debug mode is enabled.

Also, change the interval time from 1 minute to 10 seconds, because
there was no good reason that it was 1 minute and we should be
consistent. Also 1 minute is a long time to wait during a test.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (276544 => 276545)


--- trunk/Source/WebKit/ChangeLog	2021-04-24 00:40:37 UTC (rev 276544)
+++ trunk/Source/WebKit/ChangeLog	2021-04-24 00:47:50 UTC (rev 276545)
@@ -1,3 +1,27 @@
+2021-04-23  Kate Cheney  <katherine_che...@apple.com>
+
+        PCM: debug mode should send the second report on a 10 second delay after the first
+        https://bugs.webkit.org/show_bug.cgi?id=225010
+        <rdar://problem/77092303>
+
+        Reviewed by John Wilander.
+
+        Fix a bug in PCM debug mode where we don't set the timer for 10_s
+        after sending the first report for an attribution.
+
+        No new tests, this is debug mode only. Non-debug mode behavior is
+        covered by existing tests, and I tested debug mode manually.
+
+        * NetworkProcess/PrivateClickMeasurementManager.cpp:
+        (WebKit::PrivateClickMeasurementManager::firePendingAttributionRequests):
+        If the attribution has been sent to only one endpoint, indicated by
+        a non-null laterTimeToSend value, we should set the timer to be 10
+        seconds if debug mode is enabled.
+
+        Also, change the interval time from 1 minute to 10 seconds, because
+        there was no good reason that it was 1 minute and we should be
+        consistent. Also 1 minute is a long time to wait during a test.
+
 2021-04-23  Commit Queue  <commit-qu...@webkit.org>
 
         Unreviewed, reverting r275562.

Modified: trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.cpp (276544 => 276545)


--- trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.cpp	2021-04-24 00:40:37 UTC (rev 276544)
+++ trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurementManager.cpp	2021-04-24 00:47:50 UTC (rev 276545)
@@ -395,8 +395,8 @@
                 if (hasSentAttribution) {
                     // We've already sent an attribution this round. We should send additional overdue attributions at
                     // a random time between 15 and 30 minutes to avoid a burst of simultaneous attributions. If debug
-                    // mode is enabled, this should be every minute for easy testing.
-                    auto interval = debugModeEnabled() ? 1_min : 15_min + Seconds(cryptographicallyRandomNumber() % 900);
+                    // mode is enabled, this should be much shorter for easy testing.
+                    auto interval = debugModeEnabled() ? debugModeSecondsUntilSend : 15_min + Seconds(cryptographicallyRandomNumber() % 900);
                     startTimer(interval);
                     return;
                 }
@@ -407,8 +407,9 @@
                 hasSentAttribution = true;
 
                 // Update nextTimeToFire in case the later report time for this attribution is sooner than the scheduled next time to fire.
+                // Or, if debug mode is enabled, we should send the second report on a much shorter delay for easy testing.
                 if (laterTimeToSend)
-                    nextTimeToFire = std::min(nextTimeToFire, laterTimeToSend.value().secondsSinceEpoch());
+                    nextTimeToFire = debugModeEnabled() ? debugModeSecondsUntilSend : std::min(nextTimeToFire, laterTimeToSend.value().secondsSinceEpoch());
 
                 continue;
             }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to