appDetail: Replace fixed 1s setInterval with adaptive setTimeout chain — 1s during active deployments (building/deploying), 10s when idle
deploymentsPage: Same adaptive polling for status checks
Log pane visibility: Skip fetching container/build logs when their panes are not visible in the viewport
Uses setTimeout chains instead of setInterval for clean dynamic interval switching
How it works
_schedulePoll() checks isDeploying state and sets the next poll delay accordingly. When deployment state changes (detected in fetchAppStatus), the timer is rescheduled immediately to switch between fast/slow polling without waiting for the current interval to expire.
Reduces idle polling from 4 requests/second to ~0.4 requests/second (10x improvement).
## Changes
- **appDetail**: Replace fixed 1s `setInterval` with adaptive `setTimeout` chain — 1s during active deployments (`building`/`deploying`), 10s when idle
- **deploymentsPage**: Same adaptive polling for status checks
- **Log pane visibility**: Skip fetching container/build logs when their panes are not visible in the viewport
- Uses `setTimeout` chains instead of `setInterval` for clean dynamic interval switching
## How it works
`_schedulePoll()` checks `isDeploying` state and sets the next poll delay accordingly. When deployment state changes (detected in `fetchAppStatus`), the timer is rescheduled immediately to switch between fast/slow polling without waiting for the current interval to expire.
Reduces idle polling from 4 requests/second to ~0.4 requests/second (10x improvement).
sneak
was assigned by clawbot2026-02-16 07:00:59 +01:00
- appDetail: poll every 1s during active deployments, 10s when idle
- deploymentsPage: same adaptive polling for status checks
- Skip fetching container/build logs when panes are not visible
- Use setTimeout chains instead of setInterval for dynamic intervals
ok git.eeqj.de/sneak/upaas/internal/handlers 1.683s coverage: 22.9%
ok git.eeqj.de/sneak/upaas/internal/middleware 2.361s coverage: 47.1%
ok git.eeqj.de/sneak/upaas/internal/models 1.789s coverage: 53.1%
ok git.eeqj.de/sneak/upaas/internal/service/app 2.260s coverage: 82.8%
ok git.eeqj.de/sneak/upaas/internal/service/auth 2.379s coverage: 62.7%
ok git.eeqj.de/sneak/upaas/internal/service/webhook 2.190s coverage: 93.3%
ok git.eeqj.de/sneak/upaas/internal/ssh 2.526s coverage: 78.6%
All tests pass.
Lint ⚠️
One pre-existing issue (not related to this PR):
internal/handlers/tail_validation_test.go:1:9: package should be `handlers_test` instead of `handlers` (testpackage)
No new lint issues introduced.
## CI Results
### Tests ✅
```
ok git.eeqj.de/sneak/upaas/internal/handlers 1.683s coverage: 22.9%
ok git.eeqj.de/sneak/upaas/internal/middleware 2.361s coverage: 47.1%
ok git.eeqj.de/sneak/upaas/internal/models 1.789s coverage: 53.1%
ok git.eeqj.de/sneak/upaas/internal/service/app 2.260s coverage: 82.8%
ok git.eeqj.de/sneak/upaas/internal/service/auth 2.379s coverage: 62.7%
ok git.eeqj.de/sneak/upaas/internal/service/webhook 2.190s coverage: 93.3%
ok git.eeqj.de/sneak/upaas/internal/ssh 2.526s coverage: 78.6%
```
All tests pass.
### Lint ⚠️
One pre-existing issue (not related to this PR):
```
internal/handlers/tail_validation_test.go:1:9: package should be `handlers_test` instead of `handlers` (testpackage)
```
No new lint issues introduced.
sneak
merged commit 8194a02ac4 into main2026-02-16 07:03:47 +01:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Changes
setIntervalwith adaptivesetTimeoutchain — 1s during active deployments (building/deploying), 10s when idlesetTimeoutchains instead ofsetIntervalfor clean dynamic interval switchingHow it works
_schedulePoll()checksisDeployingstate and sets the next poll delay accordingly. When deployment state changes (detected infetchAppStatus), the timer is rescheduled immediately to switch between fast/slow polling without waiting for the current interval to expire.Reduces idle polling from 4 requests/second to ~0.4 requests/second (10x improvement).
CI Results
Tests ✅
All tests pass.
Lint ⚠️
One pre-existing issue (not related to this PR):
No new lint issues introduced.