chore(dashboard): fix bugs found in dashboard review#135
Open
TimVosch wants to merge 7 commits into
Open
Conversation
The traces panel on the pipeline editor dereferenced p.Pipeline.Id unconditionally, panicking when rendering the create page (Pipeline is nil). Hide the panel when there is no pipeline yet. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… prints Avoid nil resp.Body deref, return after surfacing an error instead of falling through to a nil-deref status check, and remove stray fmt.Printf debug output. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…e copy Avoid an out-of-range panic when WorkerTimes is shorter than Workers, and fix the duplicated/ungrammatical hour branches in formatSince. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… fix datastream ws error handling Build full next-page URLs (with sensor_group when filtered) instead of bare cursors; add missing returns after start/end parse errors in the datastream websocket; close per-frame websocket writers instead of deferring in a loop. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add middleware.Recoverer so handler/template panics return a clean 500 instead of dropping the connection, and remove a stray nosurf reason debug print. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…le on create, drop debug prints Always send the worker description so it can be cleared, set state from the Enabled checkbox when creating a worker, and remove stray fmt.Println debug output. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Combines six independent fixes from the dashboard review: - guard pipeline create page against nil Pipeline (panic) - preserve sensor_group in device pagination + datastream ws returns - correct pipeline update error handling + drop debug prints - guard trace worker-time indexing + fix relative-time copy - allow clearing worker description, honor enabled toggle on create - add panic recovery middleware + drop debug print Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Fixes a batch of bugs found during a review of the dashboard web app. Each fix was developed in an isolated worktree and merged together; the combined branch builds, vets, and is
gofmt-clean.Fixes
Critical
p.Pipeline.Idunconditionally; on/pipelines/createPipelineisnil, panicking mid-render. The panel is now guarded with{% if p.Pipeline != nil %}. (views/pipelineEditPage.qtpl)High
createSensorGroup/deleteSensorGrouppassed a bare cursor where a URL was expected (breaking infinite scroll), andgetDevicesTable/deviceListPageomittedsensor_groupfrom the next-page URL (page 2+ returned all devices). All four spots now build full…?sensor_group=&cursor=URLs (delete correctly omits the filter). (routes/overview.go)returns — badstart/endparams wrote an HTTP error then still tried to upgrade the socket on a committed response. Addedreturnafter each parse error. (routes/overview.go)Medium
updatePipelineerror handling — readresp.Bodywhenrespcould benil, fell through to a nil-deref status check, and had an unreachableerrors.Asbranch. Rewritten to be nil-safe and return after surfacing the error. (routes/pipelines.go)trace.WorkerTimes[j]could index out of range when the API returns fewer times than workers. Added a bounds guard. (routes/ingress.go)routes/workers.go)createWorkernow readsstateand sets it. (routes/workers.go)Low / robustness
middleware.Recovererso handler/template panics return a clean 500 instead of dropping the connection. (main.go)formatSincecopy ("About 1 hour ago" / "About 1 minute ago") and removed a duplicated branch. (routes/ingress.go)defer-ing in a loop. (routes/overview.go)fmt.Print*debug statements. (workers.go,pipelines.go,main.go)Verification
go build ./services/dashboard/...,go vet ./services/dashboard/..., andgofmt -lall clean.Not included (cosmetic / larger calls)
Worker name field styled to look disabled but editable; empty
200on non-HTMX table endpoints; external CDN dependencies; unescaped server data in inline<script>strings; deadTrace.PipelineName.🤖 Generated with Claude Code