Persist badge catalog + icon cache via ctx.storage #1

Closed
opened 2026-08-15 23:33:03 +02:00 by julian · 0 comments
Owner

Problem

The myTeamSpeak badge catalog and icon cache (backend/badges.ts, BadgeCatalog) are in-memory only. Every host restart refetches the protobuf catalog from badges-content.teamspeak.com/list and re-downloads every icon variant on first use. That is external traffic and startup latency for data that changes rarely.

Proposal

Once OpsDeck core ships module-scoped persistent storage (ctx.storage, see below), use it here:

  • Persist the parsed catalog (byGuid entries) with a fetched-at timestamp; rehydrate on register() and only refetch when stale or on the existing refresh cadence.
  • Persist fetched icons (guid + variant → bytes/content-type), respecting the existing MAX_ICON_BYTES cap; failures stay uncached as today.

Blocked by

Blocked by OpsDeck/core#37 — the ctx.storage capability does not exist yet. This issue should not start until that lands and the SDK exposes it.

## Problem The myTeamSpeak badge catalog and icon cache (`backend/badges.ts`, `BadgeCatalog`) are in-memory only. Every host restart refetches the protobuf catalog from `badges-content.teamspeak.com/list` and re-downloads every icon variant on first use. That is external traffic and startup latency for data that changes rarely. ## Proposal Once OpsDeck core ships module-scoped persistent storage (`ctx.storage`, see below), use it here: - Persist the parsed catalog (`byGuid` entries) with a fetched-at timestamp; rehydrate on `register()` and only refetch when stale or on the existing refresh cadence. - Persist fetched icons (guid + variant → bytes/content-type), respecting the existing `MAX_ICON_BYTES` cap; failures stay uncached as today. ## Blocked by **Blocked by OpsDeck/core#37** — the `ctx.storage` capability does not exist yet. This issue should not start until that lands and the SDK exposes it.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
OpsDeck/module_teamspeak#1
No description provided.