In a screen that runs maintenance across multiple sites in sequence, you want to show progress live: a blue border on "the site being processed now," a green border on "completed sites." Common UI.
The approach we reached for first was "watch the streaming logs the backend emits, and infer which site is being processed." It turned out to be surprisingly tricky — three rounds of fixes before it stabilized. This post records that trial-and-error as a design log.
The first design — "site switched, so mark the previous one done"
Logs arrive per-site as lines like [Site name] Starting maintenance. The first implementation was simple:
// Initial implementation (later found to be the root of the bugs)
function _setRunningSiteId(siteId) {
if (_runningSiteId && _runningSiteId !== siteId) {
_markCompleted(_runningSiteId); // switched to another site = previous is done
}
_runningSiteId = siteId;
}
The inference: "a new site name appeared in t
Discussion
Be the first to comment
Add your perspective to get the discussion started.