Repository navigation
feat(selfupdate): list + delete snapshots from the update modal - #151
Merged
Merged
Conversation
Follow-up to #141, driven by a field-tester request: *"en rollback funktion som listar alla snapshots, så man inte måste ssh'a in, och möjlighet att radera gamla snapshots från samma lista"* — Erik @Xorath, 2026-04-20. This PR covers the first half (list + delete). Rollback-to-snapshot is tracked as a separate PR so the review stays focused per logical change. Backend - New endpoint DELETE /api/version/snapshots/{id}. Validates the ID is a simple directory name (no traversal, no dot-segments), checks the target exists + is inside SnapshotDir, then os.RemoveAll. - GET /api/version/snapshots already returned the list — UI just wasn't showing it. Frontend - Update modal grows a collapsible "Backup snapshots (N)" section below the 🛟 hint. Shows created-at, from→to version, size in MB, and a Delete button per row. - Empty state tells the operator where snapshots come from. - Delete uses window.confirm + an optimistic "deleting…" placeholder so rapid double-clicks can't fire duplicates. - Refreshes on modal open and after every delete. Tests - TestVersionSnapshots_DeleteByID — happy path, dir gone after DELETE. - TestVersionSnapshots_DeleteRejectsInvalidID — missing id returns 404; traversal attempts are rejected by Go's ServeMux before reaching the handler (accept any non-200 outcome as sufficient). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
3 of 4 tasks
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.
Erik @Xorath (field tester) asked for snapshot management in the UI:
"en rollback funktion som listar alla snapshots, så man inte måste
ssh'a in, och möjlighet att radera gamla snapshots från samma lista".
This PR delivers the list + delete half. Rollback-to-snapshot comes next
in a focused follow-up (design sketch in #140 Phase 2 comment).
Summary
Test plan
Follow-up
PR with rollback-to-snapshot comes next. Design in #140 Phase 2 comment.
🤖 Generated with Claude Code