Skip to content

fix(monitor): prevent dashboard poller effect loops - #1485

Merged
GT-610 merged 1 commit into
mainfrom
fix/monitor-poller-effect-loop
Sep 13, 2026
Merged

fix(monitor): prevent dashboard poller effect loops#1485
GT-610 merged 1 commit into
mainfrom
fix/monitor-poller-effect-loop

Conversation

@GT-610

@GT-610 GT-610 commented Sep 13, 2026

Copy link
Copy Markdown
Collaborator

What this changes

  • Stop Poller.start() from reading reactive response data, so callers inside a Svelte $effect do not subscribe to the data that the poller later writes.
  • Add a Svelte effect harness and regression test that verifies a completed fetch does not immediately restart its poller.

Fixes #1481

How it was tested

  • npm test -- --run (10 test files, 73 tests)
  • npm run lint
  • npm run build (svelte-check: 0 errors and 0 warnings; production Vite build succeeded)
  • Red/green check: the new regression test fails with the removed reactive read restored and passes with this change.

Checklist

  • make analyze and make test pass (not run; the Flutter app is unchanged)
  • make gen was run, if any model / ARB file changed (not applicable)
  • cargo test --workspace passes, if anything under crates/ or monitor/ changed (not run; Rust code is unchanged)
  • No formatter was run over untouched code

Summary by CodeRabbit

  • Bug Fixes

    • Polling now restarts reliably without changing the loading state based on whether existing data is available.
    • Prevented enclosing Svelte effects from being unnecessarily triggered by polled data updates.
  • Tests

    • Added coverage for poller lifecycle management and effect subscription behavior.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying sbmd with  Cloudflare Pages  Cloudflare Pages

Latest commit: e57121d
Status: ✅  Deploy successful!
Preview URL: https://7e30bbc8.sbmd.pages.dev
Branch Preview URL: https://fix-monitor-poller-effect-lo.sbmd.pages.dev

View logs

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Essentials

Run ID: f8e63341-a5b8-4108-a832-a970fd3bd20d

📥 Commits

Reviewing files that changed from the base of the PR and between 15b43e1 and e57121d.

📒 Files selected for processing (3)
  • monitor/frontend/src/lib/poller.svelte.ts
  • monitor/frontend/src/tests/fixtures/PollerEffectHarness.svelte
  • monitor/frontend/src/tests/poller.test.ts
💤 Files with no reviewable changes (1)
  • monitor/frontend/src/lib/poller.svelte.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

Poller.start() no longer sets loading by reading existing poller data. A new Svelte harness resets, starts, and stops a numeric poller through $effect. A test renders the harness, waits for the first fetch, verifies one request, and unmounts the view.

Priority: ⬆️ High

Change: Bug fix · Severity of issue fixed: High

Merge Risk: ⚪ Minimal · up to e5712

The poller now avoids self-triggering effect loops, preserving normal polling intervals and dashboard loading behavior.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: preventing dashboard poller effect loops.
Linked Issues check ✅ Passed Issue #1481 requires the poller effect to stop self-triggering after fetch completion and to preserve the configured polling interval. Poller.start() no longer reads data, so the enclosing Svelte …
Out of Scope Changes check ✅ Passed The changes are limited to the poller behavior and focused regression coverage. The harness and tests directly validate the fix for issue #1481. No unrelated implementation change is shown.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/monitor-poller-effect-loop

Comment @coderabbitai help to get the list of available commands.

@GT-610
GT-610 merged commit d88cf38 into main Sep 13, 2026
16 checks passed
@GT-610
GT-610 deleted the fix/monitor-poller-effect-loop branch September 13, 2026 14:50
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.

Dashboard pollers re-trigger themselves inside $effect: ~86 req/s and 120 MB/min of /metrics/history, UI never leaves the loading state

1 participant