Wrap toISOString calls with try-catch to prevent TypeError when
date-fns-tz localToUtc returns Invalid Date in Firefox. Falls back
to the original pre-conversion date if conversion fails.
The session and event expanded metrics queries use implicit column
aliasing (`${column} name`) which causes a PostgreSQL syntax error
when the column name (like `os`) is followed by `name` without `AS`.
PostgreSQL parses `os name` ambiguously and fails with:
syntax error at or near "name"
The sibling file getPageviewExpandedMetrics.ts already uses the correct
`${column} as name` pattern. This applies the same fix to the session
and event queries.
Fixes#3970
The website_event_stats_hourly materialized view stores url_path and
url_query as independently filtered arrays, so their indices do not
correspond event-by-event. Using arrayMap to zip them would produce
wrong URL pairings and silently drop entries.
Reverted the stats_hourly path to use arrayJoin(url_path) as before.
The url_query concatenation still works correctly on direct
website_event queries (both PostgreSQL and ClickHouse).
The previous fix guarded startAt/endAt numeric values but left
startDate/endDate calling .toISOString() on the potentially invalid
result of localToUtc(), which throws TypeError in Firefox when
zonedTimeToUtc returns Invalid Date. Now falls back to raw date
.toISOString() when the UTC conversion is invalid.
Normalize usernames to lowercase on lookup, creation, and update.
Also fix variable shadowing bug and same-user update check in
the user update endpoint.
When date-fns-tz zonedTimeToUtc returns Invalid Date in Firefox,
the unary + operator produces NaN, which gets sent as "NaN" in
query parameters. Routes using z.coerce.number().int() validation
(events/series, event-data/properties) reject NaN as non-integer,
returning 400 errors and showing "Something went wrong".
This fix:
- Falls back to raw date timestamps when timezone conversion
produces NaN in useDateParameters
- Filters out NaN values in getQueryString to prevent invalid
parameters from reaching the server
Fixes#4121
Pages report now concatenates url_path and url_query when rendering
URLs, so pages like /viewtopic.php?t=1 and /viewtopic.php?t=2 are
shown as separate entries instead of collapsing into /viewtopic.php.
Applies to PostgreSQL and ClickHouse queries for path, entry, and
exit page types in both standard and expanded metrics views.
Fixes#4133