Skip to content

Keep All Messages usable during slow queries - #3105

Open
ramonsmits wants to merge 6 commits into
masterfrom
ramon/audit-query-ux
Open

Keep All Messages usable during slow queries#3105
ramonsmits wants to merge 6 commits into
masterfrom
ramon/audit-query-ux

Conversation

@ramonsmits

@ramonsmits ramonsmits commented Sep 3, 2026

Copy link
Copy Markdown
Member

Stacked on:

Five fixes that make the All Messages view behave when queries are slow (large audit stores):

  • Actionable feedback on failure: a failed or timed-out query showed a silent empty list (the error died as an unhandled watcher rejection). It now shows an alert explaining the instance might be too busy, with concrete suggestions. Pairs with the server-side query time limit in Terminate message queries that exceed a configurable time limit ServiceControl#5848.
  • Controls never lock: the filter inputs were disabled while a query ran — causing the type-one-character-lose-focus bug and locking users out for the duration of a slow query. Entering a new query is now always possible.
  • New queries supersede in-flight ones: starting a query aborts the one still running (the abort propagates through ServiceControl and terminates the database-side query) instead of silently dropping the new request; a superseded response can no longer overwrite newer results.
  • Auto-refresh cooperates with slow queries: a tick landing mid-query no longer disappears and does not cancel the running query — it refreshes as soon as the results are in. A countdown bar shows when the next refresh is due.
  • Typed searches always start: a search entered while the initial query was still running was silently ignored.
  • Leaving the view stops its activity: navigating away aborts the in-flight query and releases the auto-refresh registration.

Related:

A single control change on the All Messages view could fire the same
query up to three times: the controls watcher called the fetch after
pushing the new query to the router, the route watcher fetched again in
response to that push, and the controls watcher also watched the route
so it re-triggered itself once more. On slow audit instances the
duplicates pile up server-side and were observed running concurrently
for minutes in customer RavenDB debug packages.

The route is now the single source of truth: control changes only push
to the router, and only a route change triggers the fetch.
… out

ServiceControl now terminates audit queries that exceed the configured
query time limit. Previously any failed query left the view silently
empty (the error became an unhandled watcher rejection). The store now
records the failure and the view shows an alert explaining that the
instance might be too busy, with concrete suggestions: retry off-peak,
reduce the maximum results, or narrow the date range.
The filter controls (search text, endpoint, dates, page size, sort) and
the auto-refresh selector are no longer disabled while a query runs, so
a slow query can no longer lock the user out of the view. Only the
manual refresh button still locks, since re-running the identical query
adds nothing.

Starting a new query now aborts the one still in flight instead of
silently dropping the new request. The abort propagates through the
ServiceControl API to the database, terminating the server-side query,
and the superseded response can no longer clobber newer results.
…tdown

When the auto-refresh period is shorter than the query duration, a tick
that lands mid-query no longer disappears: the running query is left
undisturbed (not cancelled) and the refresh runs as soon as its results
are in.

A thin countdown bar under the refresh controls now depletes towards
the next auto refresh, and pulses while a due refresh is waiting on a
running query, so it is always visible when the view will update.
The controls watcher bailed out during the first load, so a search typed
while the initial (possibly minutes-long) query was still running was
silently ignored: nothing was pushed to the route, the running query was
not superseded, and no new query started.

The first-load bail-out is replaced with an idempotence check: the
watcher only pushes when the controls differ from the state the route
last applied, which both suppresses the mount-time watcher replay the
old guard was protecting against and lets a real user change through at
any time.
Navigating to another view left the in-flight audit query running (also
server-side) and never released the auto-refresh registration. The view
now aborts the running query and stops its auto-refresh on unmount; the
previously loaded rows are deliberately kept in the store so returning
to the view shows them instantly while a fresh query starts.
@ramonsmits ramonsmits added the Improvement Improvement label Sep 3, 2026
@ramonsmits ramonsmits added this to the 2.11.0 milestone Sep 3, 2026
Base automatically changed from ramon/audit-single-refresh to master September 4, 2026 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Improvement Improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants