Skip to content

fix(sentry): stop the lists flickering on background refresh - #291

Draft
tsan88 wants to merge 2 commits into
buggregator:masterfrom
tsan88:fix/sentry-list-flicker
Draft

tsan88 wants to merge 2 commits into
buggregator:masterfrom
tsan88:fix/sentry-list-flicker

Conversation

@tsan88

@tsan88 tsan88 commented Sep 4, 2026

Copy link
Copy Markdown

Stacked on the period-filter PR — it carries that commit too; the fix itself is the second commit.

On an instance with a live stream of events the sentry pages flicker constantly. Two independent causes.

1. The list was replaced by a placeholder on every refresh. The template swapped the whole list for Loading... whenever loading was true, and the footer with the item count was hidden the same way, so each refetch blanked the page and shifted the layout.

The composables now distinguish a first load from a background one — isInitialLoading = loading && !hasLoaded — so a refresh leaves the current list in place and Vue reuses the DOM by :key. A project/period/filter change still shows the loading state: that one is a response to a user action, not a background refresh.

2. Refreshes happened about once a second. The event bus debounced by 1s, but a debounce never settles on a continuous stream: every incoming event pushed the timer out, so the lists were refetched constantly (/api/sentry/counts alone was hit 1939 times a day on our instance). A minimum interval of 10s between notifications is added. Exception groups change slowly — it is mostly counters going up — so nothing meaningful is delayed.

The live event feed still updates in real time by design; the existing Listening/Paused button is unchanged.

Testing

vue-tsc --build --force clean, eslint clean on the touched files, vite build --minify succeeds. Running in production on our instance; the lists now hold still while events keep arriving.

tsan88 added 2 commits September 4, 2026 15:53
Two related gaps made a busy instance hard to use.

The sentry requests carried no scope at all: the project picked in the sidebar
had no effect on the exceptions list, so the grouped view — the view that makes
a shared instance usable — always showed every project mixed together. The
backend has had project and environment filters all along, nothing was sending
them.

And nothing could be narrowed by time. /api/events/preview returned the whole
project (tens of megabytes of JSON on our instance) and the sentry lists paged
through all of history, so reaching an error from a particular hour meant
scrolling.

Adds a period selector to the header (1h … 30d, All time; stored in
localStorage, 24h by default) whose value is sent as ?window= alongside the
project, and refetches the feed and the sentry lists when either changes.

Server-side support for window/project is in buggregator/server; an older server
simply ignores the extra parameters.
On an instance with a live stream of events the sentry pages flickered
constantly. Two causes:

1. The lists were replaced by a placeholder on every refresh. The template
   swapped the whole list for "Loading..." whenever loading was true, and the
   footer with the group count was hidden the same way, so each refetch blanked
   the page and shifted the layout. The composables now distinguish a first load
   from a background one (isInitialLoading = loading && !hasLoaded), so a
   refresh leaves the current list in place and Vue reuses the DOM by :key.
   A project/period/filter change still shows the loading state — that one is a
   response to a user action.

2. Refreshes happened about once a second. The event bus debounced by 1s, but a
   debounce never settles on a continuous stream: every incoming event pushed
   the timer and the lists were refetched constantly. A minimum interval of 10s
   between notifications is added; exception groups change slowly (counters
   going up), so nothing meaningful is delayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant