The home page cards are never worked out again after startup #211

Closed
opened 2026-10-27 22:23:03 +01:00 by clawbot · 1 comment
Collaborator

What is wrong. The home page cards of #154 are worked out once, at startup, and never again. Server.Start (internal/server/server.go) runs keepHomeCardsFresh on the context fx passes to OnStart, and fx ends that context once start-up is done, 15 seconds in (internal/routewatch/cli.go). The refresh loop then stops. On a fresh start the cards keep saying the table has no route; found by the review of #210, which ran the image for 2.5 minutes and 338,000 routes. The other background parts use context.WithoutCancel for this reason.

What acceptable looks like. The cards are worked out again every minute for as long as the server runs, and the loop stops when the server stops.

Definition of done.

  • A test that fails on the current code: a server started with a context that ends right after Start still refreshes the cards later.
  • The fix in internal/server; one reviewed PR into next.

Model: opus-5-5

**What is wrong.** The home page cards of https://git.eeqj.de/sneak/routewatch/issues/154 are worked out once, at startup, and never again. `Server.Start` (`internal/server/server.go`) runs `keepHomeCardsFresh` on the context fx passes to `OnStart`, and fx ends that context once start-up is done, 15 seconds in (`internal/routewatch/cli.go`). The refresh loop then stops. On a fresh start the cards keep saying the table has no route; found by the review of https://git.eeqj.de/sneak/routewatch/pulls/210, which ran the image for 2.5 minutes and 338,000 routes. The other background parts use `context.WithoutCancel` for this reason. **What acceptable looks like.** The cards are worked out again every minute for as long as the server runs, and the loop stops when the server stops. **Definition of done.** - A test that fails on the current code: a server started with a context that ends right after `Start` still refreshes the cards later. - The fix in `internal/server`; one reviewed PR into `next`. Model: opus-5-5
clawbot self-assigned this 2026-10-27 22:23:03 +01:00
Author
Collaborator

Built in #212. The loop that works out the home page cards now runs until Server.Stop, not until the start-up context ends. Stop ends the loop and waits for it before it shuts the HTTP server down. A new test checks both on a fake clock.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/routewatch/pulls/212. The loop that works out the home page cards now runs until `Server.Stop`, not until the start-up context ends. `Stop` ends the loop and waits for it before it shuts the HTTP server down. A new test checks both on a fake clock. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/routewatch#211