Skip to content

Staleness

Vocino edited this page Aug 20, 2026 · 5 revisions

Staleness — trust but verify

Site shows per-char dot + hover metadata. Freshness lives per section inside payload, not on D1 row — because bundle pasted this minute can carry 9-day-old bank.

Dot thresholds (mirrors addon ns.dot() in Init.lua)

From src/lib/warband-import.ts: same three numbers on both sides. If these move, move both.

  • 🟢 Fresh under 6h
  • 🟡 Aging under 3d
  • 🔴 Stale beyond 3d
  • ⚪ Never (stamp absent)

character_addon_cache.fetched_at_ms answers only "when did user last paste". Section dot answers "how current is this section".

Stored in seenAt.{lastSeen, bag, bank, warbank, currency, instance, vault, mail, auctions, profession} — unix seconds (WoW time() / GetServerTime()), web converts ms. Mist reading seconds as ms lands 1970 → all stale. Ms as seconds → year 56000 → all fresh forever. Tests assert both directions.

UI

  • Site Inspector "Addon import" section
  • Hover: "Bags 2h ago, Bank 5d ago (open bank to refresh), Warbank 14d"
  • Tonight Plan:
    • 0 phials + fresh 20m → hard block "hit AH before raid"
    • 0 phials + 5d old → grey "per last import 5d ago — verify?" not block
  • Preview table on import keeps old snapshot if char missing from bundle — aging red, never deleted. Missing ≠ gone.

Unknown vs Zero

Critical UX rule from flow:

  • Bank never opened → omit section → UI not opened not 0 free (0 free reads full bank, sends to clear space you have)
  • Consumables unknown until id table filled → absent not zero (Tonight Plan would hard-block on 0)

Data never deletes, stale just lowers confidence. warband_import.ts Freshness union fresh|aging|stale|never.

Warband bank trust

  • Warbank seen 1h ago by Vocnar still present even if you exported from Voctara who didn't open bank — shared acct-wide tabs.
  • Dots: "Warbank 1h ago (by Vocnar)" credit line.
  • Tabs account-wide warband_bank_cache one row per user, char seenAt.warbank per-char for who last stood at banker.

App-side freshness line (why sink matters)

Top-right [ ↻ sync / ↥ import ▼] bottom small: API 12m · Addon freshest 2h · Warbank 1d (by Vocnar)

Immediate trust signal glance.

Addon panel freshness

Export panel WarbandProExportFrame header: 6 chars · freshest 12m ago · Warbank 1h ago (by Vocnar) — so you know before copying it's not stale.

Auto-sync consideration

Bnet side has $ sync refreshing roster/vitals/lockouts and reloads (deliberate — rail $ sync block server-rendered, in-place refresh would leave freshness readout lying). Addon side import NEVER reloads — only that one line stamped.

Tested via

  • docs/contract/vectors/v1-min.json freshness sanity
  • Manual: open bank → export → paste → hover shows bank now fresh 🟢

Warband.pro Companion

Home

Start

Integration

Internals

Clone this wiki locally