Knick Catan League2026 Season · Classic

Avatar System Diagnostics

Read-only. Exercises the real buildAvatarSrc() and PlayerAvatarWithFallback — no data is modified.

1. URL Builder (production function)

No version info → bare URL, no ?v=

https://example.com/a.jpg

profileImageUpdatedAt present → ?v= appended

https://example.com/a.jpg?v=2024-01-01T00%3A00%3A00Z

Missing profileImageUpdatedAt → falls back to updated_date (not Date.now())

https://example.com/a.jpg?v=2023-06-01T00%3A00%3A00Z

Source URL already has "?" → uses "&" not a second "?"

https://example.com/a.jpg?w=200&v=2024-01-01T00%3A00%3A00Z

Retry adds &retry=1 (deterministic, not random)

https://example.com/a.jpg?v=2024-01-01T00%3A00%3A00Z&retry=1

Same inputs → identical URL every call (stable across rerenders)

No URL → returns null (no crash)

2. Live Component Cases

VP
Valid Player

Valid image → should load

BP

Broken URL → retries once, then initials "BP" (no broken-icon)

NF
No Version Field

profileImage set, no profileImageUpdatedAt/updated_date → bare URL, still loads

?

Missing Player record entirely → safe "?" initials, no crash

3. Broken → Valid Player Switch (same component instance)

BB

Showing Bob Baker (broken URL) — retries once, then "BB" initials

Auto-switches to the valid player 2.5s after page load, proving the reset happens live in one mounted instance — no manual click required to observe it.