Repository navigation
fix: wake a sleeping engine before listing its snapshots - #2268
Conversation
Opening an engine's Snapshots tab, whether from the Services page or the camera button on a site's service card, showed "No snapshots yet" whenever the engine was asleep. The tab asked for the listing straight away, an asleep engine answers with no databases, and the snapshots ride along with those databases, so the list came back empty and nothing asked again once the engine was up. The tab now does what the Databases tab already does: it keeps the engine awake while open, shows a loading row until the engine is ready, and only then loads the listing. A stopped engine shows the start hint instead of claiming there are no snapshots.
[Medium impact] The PR appears safe to merge, with both previous findings fixed. SummaryThe Snapshots tab wakes sleeping engines, waits before requesting their snapshots, and asks users to start stopped engines.
Reviews (2) · Last reviewed commit: "docs: say the Snapshots tab wakes a slee..." · Reviewed by Greptile |
| {#if stopped} | ||
| <p class="text-sm text-gray-500 dark:text-gray-400">{m.databases_startHint()}</p> | ||
| {:else if !up} | ||
| <LoadingRow /> |
There was a problem hiding this comment.
This changes what users see for sleeping and stopped engines, but no documentation changes accompany it. CLAUDE.md requires a relevant docs/ update for every behavior change. Before merging, document that opening Snapshots wakes a sleeping engine and that a stopped engine must be started.
Context Used: CLAUDE.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: internal/ui/web/src/tabs/services/ServiceSnapshotsTab.svelte
Line: 340-343
Comment:
**Wake behavior is undocumented**
This changes what users see for sleeping and stopped engines, but no documentation changes accompany it. `CLAUDE.md` requires a relevant `docs/` update for every behavior change. Before merging, document that opening Snapshots wakes a sleeping engine and that a stopped engine must be started.
**Context Used:** CLAUDE.md ([source](https://github.com/lerd-env/lerd/blob/main/CLAUDE.md))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Fair, the Snapshots tab entry in the web UI docs now says opening it wakes a sleeping engine and that a stopped one has to be started first. In e412a34.
| // The snapshots ride along with the engine's databases, so the tab reads the | ||
| // same listing the Databases tab does rather than fetching its own, and skips | ||
| // a service that has no databases for the same reason it does. | ||
| // a service that has no databases for the same reason it does. An asleep | ||
| // engine lists nothing, so it is woken the same way and asked once ready. |
There was a problem hiding this comment.
This expands the comment from three lines to four. CLAUDE.md limits comment blocks to two or three lines. Before merging, shorten it while keeping the reason for waiting until the engine is ready.
| // The snapshots ride along with the engine's databases, so the tab reads the | |
| // same listing the Databases tab does rather than fetching its own, and skips | |
| // a service that has no databases for the same reason it does. | |
| // a service that has no databases for the same reason it does. An asleep | |
| // engine lists nothing, so it is woken the same way and asked once ready. | |
| // Snapshots arrive with the engine's databases. A sleeping engine lists | |
| // nothing, so wake it and wait until it is ready before loading. |
Context Used: CLAUDE.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: internal/ui/web/src/tabs/services/ServiceSnapshotsTab.svelte
Line: 43-46
Comment:
**Comment exceeds the limit**
This expands the comment from three lines to four. `CLAUDE.md` limits comment blocks to two or three lines. Before merging, shorten it while keeping the reason for waiting until the engine is ready.
```suggestion
// Snapshots arrive with the engine's databases. A sleeping engine lists
// nothing, so wake it and wait until it is ready before loading.
```
**Context Used:** CLAUDE.md ([source](https://github.com/lerd-env/lerd/blob/main/CLAUDE.md))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Trimmed it to two lines, keeping why it waits for the engine to be ready. In e412a34.
Opening an engine's Snapshots tab, whether from the Services page or the camera button on a site's service card, showed "No snapshots yet" whenever the engine was asleep. The tab asked for the listing straight away, an asleep engine answers with no databases, and since the snapshots ride along with those databases the list came back empty and nothing asked again once the engine was up.
The tab now does what the Databases tab already does: it keeps the engine awake while open, shows a loading row until the engine is ready, and only then loads the listing. A stopped engine shows the start hint instead of claiming there are no snapshots.