analytics/test/plausible_web/controllers/api/stats_controller
Vini Brasil 535874be6f
Reject unknown imported cities from queries (#2675)
* Reject unknown imported cities from queries

This commit fixes a bug where the city report returned `N/A` entries.
The functions that build imported data queries were using SQL
`COALESCE`, assuming city data is `NULL` when unknown, when actually its
unknown value is `0`.

This commit addresses the problem using SQL `NULLIF` combined with the
previous `COALESCE` call. With this change both `0` and `NULL` are
treated as unknown.

Since 1cb07efe6d cities can be `NULL`, but
previously we saved `0` as unknown.

Closes #1960

* Add entry to CHANGELOG

* Ignore cyclomatic complexity Credo check
2023-02-15 07:35:35 -03:00
..
authorization_test.exs Google APIs integration improvements (#2358) 2022-10-24 09:34:02 +02:00
browsers_test.exs Replace empty OS/screen size/Browser with (not set) in UI/API/exports (#2646) 2023-02-07 12:47:54 +01:00
cities_test.exs Reject unknown imported cities from queries (#2675) 2023-02-15 07:35:35 -03:00
conversions_test.exs Fix 'field key does not exist' error (#2674) 2023-02-14 08:57:38 -03:00
countries_test.exs Fix breakdown API pagination when using event metrics (#2562) 2023-01-04 22:14:40 -03:00
current_visitors_test.exs Google APIs integration improvements (#2358) 2022-10-24 09:34:02 +02:00
main_graph_test.exs Add support for intervals (#1574) 2022-11-22 09:50:58 -03:00
operating_systems_test.exs Replace empty OS/screen size/Browser with (not set) in UI/API/exports (#2646) 2023-02-07 12:47:54 +01:00
pages_test.exs Fix breakdown API pagination when using event metrics (#2562) 2023-01-04 22:14:40 -03:00
regions_test.exs Google APIs integration improvements (#2358) 2022-10-24 09:34:02 +02:00
screen_sizes_test.exs Replace empty OS/screen size/Browser with (not set) in UI/API/exports (#2646) 2023-02-07 12:47:54 +01:00
sources_test.exs Fix breakdown API pagination when using event metrics (#2562) 2023-01-04 22:14:40 -03:00
suggestions_test.exs Add API support for intervals (#2417) 2022-11-14 18:41:51 -03:00
top_stats_test.exs Change metric labels for realtime with goal filter (#2560) 2023-01-09 09:31:55 +02:00