monoscope/shared
Anthony Alaribe 04d90a5e74
TimeFusion follow-ups: array_has lowering, chart refresh backoff, bounded issue lookups; serialized fixture e2e specs (#610)
* Issues: optional page lookups give up after 10 seconds

The replay-session lookup could stall the issue page for up to 77s on a
cold TimeFusion read; enriching already degrades to no session data on
Nothing, so a bound is all it needed.

* Charts: a failing refresh backs off exponentially instead of re-firing every tick

An issue chart whose query hits TimeFusion's 90s timeout re-issued that
query on every 15s live tick. After a failure the chart now waits 15s,
doubling per consecutive failure up to 10 minutes; success or a user-driven
fetch (manual refresh, query or time-range change) resets and bypasses it.

* KQL: hashes[*]=="x" lowers to array_has on TimeFusion

jsonb_path_exists(to_jsonb(hashes), …) is what times out the Talstack
issue charts; DataFusion's native array_has computes the same answer far
cheaper (plans/array-has-lowering.md). Equality only, bare wildcard only,
real array columns only (hashes, summary — pinned to the DDL, since the
telemetry schema types events as an array but it is JSONB), TimeFusion
only: the Postgres lowering is byte-identical.

* e2e: every spec that seeds shared fixture rows runs in the serialized project

Under four parallel workers the navbar refresh-menu case in
container-identity failed on master's Deploy for 5bee041d4; it had passed
every run with one worker. Every spec that calls sql() against the shared
demo project's rows (container-identity, endpoint-analytics, host-map,
infrastructure-time-window, metric-exemplars, metrics-catalog, rum-sessions,
tabs) now belongs to the chromium-fixtures project, so the next flake is not
just the next spec on the list.

* Parser: the TimeFusion flag is named for what it gates; doctests pin the flag-to-SQL chain

metricJsonAsVariant now also selects the array_has lowering, so it is
targetsTimefusion. Doctests on parseQueryToComponents pin array_has with
the flag on and the byte-identical jsonpath form with it off. The
enriching haddock says the ten-second bound degrades too.

* Auto-format code with fourmolu

* Parser: drop mapSubjects, orphaned by the expression hook (weeder)

* e2e: infra fixture specs wait out the container snapshot TTL after seeding

Infrastructure pages serve one snapshot per (project, window) for at least
30s. In the serialized project the specs seed the shared demo project back
to back, so a neighbour's page load hid the next spec's hosts (host-map's
host missing; 0 of 2 hosts after a preset switch to 1H). Waiting 31s after
seeding removes the coupling whatever the order.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
History 2026-09-30 17:35:53 +02:00
..
src TimeFusion follow-ups: array_has lowering, chart refresh backoff, bounded issue lookups; serialized fixture e2e specs (#610) 2026-09-30 17:35:53 +02:00
monoscope-shared.cabal Give each wire type's schema a home on the record it describes 2026-09-11 13:28:54 +02:00