Skip to content

Release v1.15.3 — analytics view: blocked filter + Blocked Queries panel + Pacific timestamps#116

Merged
jpr5 merged 1 commit into
mainfrom
feat/v1.15.3-analytics-fixes
Jun 17, 2026
Merged

Release v1.15.3 — analytics view: blocked filter + Blocked Queries panel + Pacific timestamps#116
jpr5 merged 1 commit into
mainfrom
feat/v1.15.3-analytics-fixes

Conversation

@jpr5

@jpr5 jpr5 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Three operator-facing /analytics fixes shipped together:

  1. Hide blocked=true rows from "Empty Result Queries (Last 7 days)" — v1.15.2 already short-circuits these via the blocklist; they were visible in the empty-result table only because the SQL filtered on result_count = 0 alone. Added AND blocked = false to getEmptyQueries. Predicate is safe for historical rows that predate the column (schema declares BOOLEAN NOT NULL DEFAULT FALSE).
  2. New "Blocked Queries (Last 7 days)" panel on /analytics — count + last_seen + up to 5 sample queries per block_reason, surfaced via a new /api/analytics/blocked-queries route. Operator can now see the blocklist actively catching abuse. Window honors days but takes no other filter params (the rows it surfaces never reached the layer those filters describe).
  3. All timestamps now render in Pacific time (America/Los_Angeles, DST-aware via Intl.DateTimeFormat) — emits e.g. 2026-06-17 09:40:32 PDT (or PST in winter) instead of UTC. Storage (Postgres TIMESTAMPTZ in UTC), server-side window math, and the URL from/to contract are all unchanged — only the display side of absolute-instant cells flips.

No search API or telemetry changes — operator-facing only.

Test coverage

  • getEmptyQueries SQL now contains blocked = false (regression-pinned).
  • getBlockedQueries returns one row per block_reason, groups null-reason rows under <unknown>, orders by hits DESC, and uses a parameterized window interval.
  • /api/analytics/blocked-queries route: 200 with valid token, 401 without, 500 envelope on DB-layer rejection.
  • Dashboard UI: empty-queries last_seen cell renders PDT (June) and PST (January) markers; missing/non-parseable values render an em-dash; new Blocked Queries panel fetches the endpoint, renders one row per reason with PDT marker, joined sample queries, and shows a 'No blocked queries' fallback when empty.

Notes for reviewer

  • The pre-existing UTC scaffolding (parseISODate, todayISO, tomorrowISO, the shortDateFmt pill formatter) is intentionally NOT changed — those govern the URL from/to contract and date-picker math, which must stay UTC-aligned with the server's window math. Only operator-facing absolute timestamps flip to Pacific.
  • Pre-existing failures in cli.test.ts (dist-not-built env) are out of scope; verified they fail identically on main.

…cked Queries panel, Pacific timestamps

- Empty Result Queries (Last 7 days) excludes blocked=true rows so the
  v1.15.2 blocklist short-circuits don't double-count as 'real users found
  nothing' content gaps. Predicate is 'blocked = false', safe for historical
  rows (schema declares BOOLEAN NOT NULL DEFAULT FALSE).
- New Blocked Queries (Last 7 days) panel on /analytics — count + last_seen
  + up to 5 sample queries per block_reason, surfaced via a new
  /api/analytics/blocked-queries route. Window honors 'days' but no filter
  wiring (the rows the blocklist short-circuited never reached the layer
  filters describe).
- Every absolute timestamp on the /analytics dashboard now renders in
  America/Los_Angeles via Intl.DateTimeFormat (DST-aware: PDT in summer,
  PST in winter). Storage (Postgres TIMESTAMPTZ in UTC), server window math,
  and URL from/to contract are unchanged — only display flips.
@jpr5
jpr5 merged commit f8f7ab7 into main Jun 17, 2026
12 of 13 checks passed
@jpr5
jpr5 deleted the feat/v1.15.3-analytics-fixes branch June 17, 2026 18:05
jpr5 added a commit that referenced this pull request Jun 17, 2026
Reverts PR #116. The v1.15.3 `getBlockedQueries` SQL throws against real
Postgres, and the client-side `Promise.all` rejection blanks the entire
/analytics page with 'Failed to load analytics: Failed to fetch blocked
queries'.

Restoring v1.15.2 immediately to get the page working again. The three
v1.15.3 changes (blocked filter, Blocked Queries panel, Pacific
timestamps) will re-ship as v1.15.4 after explicit local verification
against the real Postgres schema.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant