From 63e410171acab8d6537a6eb8de41119e1ae05937 Mon Sep 17 00:00:00 2001 From: Ondra Date: Wed, 22 Nov 2023 09:17:44 +0100 Subject: [PATCH 1/2] fix first load incremental fetching --- src/GoogleAnalytics/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GoogleAnalytics/Client.php b/src/GoogleAnalytics/Client.php index efd1eb8..5faaf58 100644 --- a/src/GoogleAnalytics/Client.php +++ b/src/GoogleAnalytics/Client.php @@ -437,7 +437,7 @@ public static function getDelayFn(int $base = 5000): \Closure public function getStartDate(string $startDate): string { if ($startDate === Config::STATE_LAST_RUN_DATE) { - $startDate = $this->inputState[Config::STATE_LAST_RUN_DATE] ?? '2005-01-01'; + $startDate = $this->inputState[Config::STATE_LAST_RUN_DATE] ?? '2015-08-13'; } return $startDate; } From 49162f658466bb0e5e2bb6787623e2b8395b1a55 Mon Sep 17 00:00:00 2001 From: Ondra Date: Wed, 22 Nov 2023 09:31:24 +0100 Subject: [PATCH 2/2] fix test --- .../expected/data/out/state.json | 2 +- .../expected/data/out/tables/users.csv | 23 +++++++++++-------- .../source/data/config.json | 2 +- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/tests/functional/query-data-ranges-last-run/expected/data/out/state.json b/tests/functional/query-data-ranges-last-run/expected/data/out/state.json index a531b5d..9a6ec0d 100644 --- a/tests/functional/query-data-ranges-last-run/expected/data/out/state.json +++ b/tests/functional/query-data-ranges-last-run/expected/data/out/state.json @@ -1 +1 @@ -{"lastRunDate":"2005-01-10"} \ No newline at end of file +{"lastRunDate":"2015-08-25"} \ No newline at end of file diff --git a/tests/functional/query-data-ranges-last-run/expected/data/out/tables/users.csv b/tests/functional/query-data-ranges-last-run/expected/data/out/tables/users.csv index 31eb726..37fbd22 100644 --- a/tests/functional/query-data-ranges-last-run/expected/data/out/tables/users.csv +++ b/tests/functional/query-data-ranges-last-run/expected/data/out/tables/users.csv @@ -1,11 +1,14 @@ "id","idProfile","date","pageviews" -"30e172623f372214ef62c64d2de271d8045ba21f","184062725","2005-01-01","0" -"f4a31a742dd75a53e937f0c352445b748e952f2f","184062725","2005-01-02","0" -"9bb41318f3abcc0792c487149444b742b08b3caa","184062725","2005-01-03","0" -"662580ec6a65eb86397fee33e02cd41919bfcf8a","184062725","2005-01-04","0" -"2c4bd037eb8677c92103c32ea5b62a4ec8924fab","184062725","2005-01-05","0" -"34fbdc5c1b9aab8feee192677f825ee24224b6e2","184062725","2005-01-06","0" -"aa6342e47c4bf7904b9b24afb74266bd946f01cf","184062725","2005-01-07","0" -"1f2c7dfce76d14cb585578d5688902ecb2af5b7d","184062725","2005-01-08","0" -"1f23e4a6d063de1ed8d28addbde68fd0240be8bb","184062725","2005-01-09","0" -"943fa16670cde6ec53479e08dac97b1f1e23d5e4","184062725","2005-01-10","0" +"e1d1fbbee5da9f1f77ec3b0d4e99efd693c728e5","184062725","2015-08-13","0" +"834150284d702ba6d290b36ae0a7254cfcf6bbcf","184062725","2015-08-14","0" +"e3c13491127a3ddb754ae588a19de1d5fc17f138","184062725","2015-08-15","0" +"1b6f3aefc44854359d30a18d6d3e0e0ef0c1ee1a","184062725","2015-08-16","0" +"4abe298e2c9f82f10407ecda10bb440e803cdcb4","184062725","2015-08-17","0" +"295dc87bff9c2ca5d267a2f57c5d7a344700ecf2","184062725","2015-08-18","0" +"ce0bf83a0af2f40586547672a87efef5667b44f1","184062725","2015-08-19","0" +"d800f0eef6898cbaa0760db4457a3a51ca42decf","184062725","2015-08-20","0" +"6677f21e65bf96772da6ce755c95a242a7ba51b1","184062725","2015-08-21","0" +"38cf4e9d8e93c301363675fc0049fe5c3c6fb2b5","184062725","2015-08-22","0" +"faac270b87d8d54837c442851a2e4ffea453549c","184062725","2015-08-23","0" +"754c7f4e0bc292f8d71a6b8bcc2009c8a363c421","184062725","2015-08-24","0" +"a233c349bbba7960d0825933dbd05e23a93e8252","184062725","2015-08-25","0" diff --git a/tests/functional/query-data-ranges-last-run/source/data/config.json b/tests/functional/query-data-ranges-last-run/source/data/config.json index b157ae1..53549c0 100644 --- a/tests/functional/query-data-ranges-last-run/source/data/config.json +++ b/tests/functional/query-data-ranges-last-run/source/data/config.json @@ -36,7 +36,7 @@ "dateRanges": [ { "startDate": "lastRunDate", - "endDate": "2005-01-10" + "endDate": "2015-08-25" } ] }