feat(speedtest): add manual speedtest trigger button#259
Merged
Conversation
Add a "Run Speedtest" button to the speedtest page that triggers a speedtest via the Speedtest Tracker API. The request is proxied through the DOCSight backend so installations that don't expose STT ports to the LAN can still trigger tests. - POST /api/speedtest/run endpoint with 60s rate limiting - Frontend polls for the result and shows a toast on completion - i18n keys for EN/DE/FR/ES
A speedtest takes at least 30 seconds. Polling every 5s from the start wastes requests. Now waits 30s before starting to poll.
- Block trigger endpoint in demo mode (returns 400) - Add .catch() to poll loop so transient errors don't leave the button stuck in loading state - Fetch latest ID from the server before triggering instead of using stale client-side cache, preventing false-positive result matching
The button is not rendered in demo mode since the backend rejects the request anyway. Avoids showing a primary action that can only fail.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
POST /api/speedtest/runendpoint with 60s rate limitingTest plan
.venv/bin/pytest tests/test_speedtest.py -v(26 passed)python scripts/i18n_check.py --validate(all in sync)Fixes #255