Bump GA4 import page limit to max 250k (#4045)
* Bump GA4 page limit to 250k * Handle empty properties list response gracefully
This commit is contained in:
parent
805b5acbc7
commit
ca25b6c764
|
|
@ -14,7 +14,7 @@ defmodule Plausible.Google.GA4.API do
|
|||
expires_at :: String.t()
|
||||
}
|
||||
|
||||
@per_page 50_000
|
||||
@per_page 250_000
|
||||
@backoff_factor :timer.seconds(10)
|
||||
@max_attempts 5
|
||||
|
||||
|
|
@ -37,6 +37,9 @@ defmodule Plausible.Google.GA4.API do
|
|||
|
||||
{:ok, accounts}
|
||||
|
||||
{:ok, _} ->
|
||||
{:ok, []}
|
||||
|
||||
{:error, cause} ->
|
||||
{:error, cause}
|
||||
end
|
||||
|
|
|
|||
|
|
@ -27,6 +27,14 @@ defmodule Plausible.Google.GA4.APITest do
|
|||
]}
|
||||
] = accounts
|
||||
end
|
||||
|
||||
test "handles empty response properly" do
|
||||
expect(Plausible.HTTPClient.Mock, :get, fn _url, _opts ->
|
||||
{:ok, %Finch.Response{status: 200, body: %{}}}
|
||||
end)
|
||||
|
||||
assert {:ok, []} = GA4.API.list_properties("some_access_token")
|
||||
end
|
||||
end
|
||||
|
||||
describe "get_property/2" do
|
||||
|
|
|
|||
Loading…
Reference in New Issue