Matches stay "In progress" with a growing time after their server stops reporting #136

Closed
opened 2026-10-10 00:48:25 -04:00 by goddard · 1 comment
Collaborator

A match stays "In progress" until its server reports a new match or the server is deleted. Since #115, Matches also shows a running time and a live link for every in-progress match. So when a server stops or its host goes offline, its last match keeps counting up.

  • leaderboard-ingest.ts:83-88 ends a server's open match only when that server reports a new one, and server-history.ts:149 ends it when the server is deleted. Nothing else changes a match's status.
  • Stopping a server doesn't end its match. native.ts:1538-1550 confirms the container stopped and leaves the match open, and so does a crash or an offline host.
  • The Servers page marks such a server offline once its last report is more than 2 minutes old (server-observation.ts:186-192) and counts no live matches. Matches still shows the running time and "View live … match" link for it (MatchHistory.svelte:334-339,349-357).

This is the case #48 described. A match now ends when the next match starts or the server is deleted, but not when the server stops or stops reporting.

Screenshots

The fixture was seeded 26 hours in the past with no live updates, so every server last reported 26 hours ago, as if its host went offline.

Before, Matches:
Before, Matches

Before, Servers at the same moment:
Before, Servers

After (mockup), Matches:
After (mockup)

Fix

  • Mark a server's open match interrupted when the server is stopped, as deletion already does
  • On Matches, show the running time and live link only while the server is reporting; otherwise show "Not reporting" with the time of the last report
A match stays "In progress" until its server reports a new match or the server is deleted. Since #115, Matches also shows a running time and a live link for every in-progress match. So when a server stops or its host goes offline, its last match keeps counting up. - `leaderboard-ingest.ts:83-88` ends a server's open match only when that server reports a new one, and `server-history.ts:149` ends it when the server is deleted. Nothing else changes a match's status. - Stopping a server doesn't end its match. `native.ts:1538-1550` confirms the container stopped and leaves the match open, and so does a crash or an offline host. - The Servers page marks such a server offline once its last report is more than 2 minutes old (`server-observation.ts:186-192`) and counts no live matches. Matches still shows the running time and "View live … match" link for it (`MatchHistory.svelte:334-339,349-357`). This is the case #48 described. A match now ends when the next match starts or the server is deleted, but not when the server stops or stops reporting. **Screenshots** The fixture was seeded 26 hours in the past with no live updates, so every server last reported 26 hours ago, as if its host went offline. Before, Matches: ![Before, Matches](https://gitea.thewrightserver.net/attachments/8f297c96-23e8-4646-94e5-2b216ed1c6de) Before, Servers at the same moment: ![Before, Servers](https://gitea.thewrightserver.net/attachments/65a8c709-b9c7-4992-9f02-e398af9d2d07) After (mockup), Matches: ![After (mockup)](https://gitea.thewrightserver.net/attachments/2b708171-d988-4d3f-be6b-52416c77ef08) **Fix** - [x] Mark a server's open match interrupted when the server is stopped, as deletion already does - [x] On Matches, show the running time and live link only while the server is reporting; otherwise show "Not reporting" with the time of the last report
goddard added the
priority
low
type/bugtype/ux
labels 2026-10-10 00:48:25 -04:00
josh was assigned by goddard 2026-10-10 00:48:25 -04:00
Author
Collaborator

Reviewed 03e2d08a38. Both fix items are done, so I'm closing this.

Checklist

  • Interrupt the open match on stop. Once the agent confirms the container stopped, native.ts:1562 marks the server's active, undeleted match interrupted, in the same transaction that records the stopped container. ended_at is the time the container was seen stopped. This covers every stop: lifecycle requests need a native instance (requests.ts:263-264), and native stop jobs are the only source of instance.stop (native.ts:2153). native-provisioning.test.ts checks this for each stopped container state and leaves the match open when the stop fails or its outcome is unknown.
  • Show "Not reporting" when reports stop. MatchHistory.svelte:335-339 treats an in-progress match as reporting only while its last report is within 90 s (freshStatusTimestamp). That's the same telemetry check the Servers page uses (server-observation.ts:53), so the two pages agree. Otherwise the match shows "Not reporting" and "Last report …", with no duration and no live link. Identical reports now refresh last_received_at (leaderboard-ingest.ts:70-77), so a live match whose state hasn't changed still counts as reporting.

Review notes

  • Checked in the preview. With the fixture dated 26 hours back, the six open matches show "Not reporting · Last report Yesterday, 6:07 PM" with no duration or live link, on desktop and on a phone. With a live fixture they still show "In progress" with a running time and live link.
  • Good extra catch: an identical heartbeat after an interrupted match now starts a new match instead of being dropped (leaderboard-ingest.ts:77, with a test).
  • The 6 affected test files pass locally (253 tests): leaderboard-ingest, native-provisioning, match-history-query, ui-match-chat, ui-match-history and ui-style-check. Run 858 passed on this commit.
Reviewed 03e2d08a38578b08ece21829c298b0d9c0ce7df9. Both fix items are done, so I'm closing this. **Checklist** - [x] **Interrupt the open match on stop.** Once the agent confirms the container stopped, `native.ts:1562` marks the server's active, undeleted match interrupted, in the same transaction that records the stopped container. `ended_at` is the time the container was seen stopped. This covers every stop: lifecycle requests need a native instance (`requests.ts:263-264`), and native stop jobs are the only source of `instance.stop` (`native.ts:2153`). `native-provisioning.test.ts` checks this for each stopped container state and leaves the match open when the stop fails or its outcome is unknown. - [x] **Show "Not reporting" when reports stop.** `MatchHistory.svelte:335-339` treats an in-progress match as reporting only while its last report is within 90 s (`freshStatusTimestamp`). That's the same telemetry check the Servers page uses (`server-observation.ts:53`), so the two pages agree. Otherwise the match shows "Not reporting" and "Last report …", with no duration and no live link. Identical reports now refresh `last_received_at` (`leaderboard-ingest.ts:70-77`), so a live match whose state hasn't changed still counts as reporting. **Review notes** - Checked in the preview. With the fixture dated 26 hours back, the six open matches show "Not reporting · Last report Yesterday, 6:07 PM" with no duration or live link, on desktop and on a phone. With a live fixture they still show "In progress" with a running time and live link. - Good extra catch: an identical heartbeat after an interrupted match now starts a new match instead of being dropped (`leaderboard-ingest.ts:77`, with a test). - The 6 affected test files pass locally (253 tests): `leaderboard-ingest`, `native-provisioning`, `match-history-query`, `ui-match-chat`, `ui-match-history` and `ui-style-check`. [Run 858](https://gitea.thewrightserver.net/josh/electric-cherry/actions/runs/858) passed on this commit.
Sign in to join this conversation.