Skip to content

Write Blizzard levels from the popup back onto WoW cards - #40

Merged
Lucrona merged 1 commit into
wow-playedfrom
fix/wow-card-level-refresh
Nov 11, 2026
Merged

Lucrona merged 1 commit into
wow-playedfrom
fix/wow-card-level-refresh

Conversation

@Lucrona

@Lucrona Lucrona commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Change

The WoW character popup already fetches a fresh Blizzard profile, so it showed the real level. The small profile and View all cards did not, because they read shown_level from wow_characters (bnet_level when it is newer than the last /played upload; otherwise the addon's level).

Forever's popup refresh stored that profile only in the details cache and never wrote bnet_level. Retail already wrote it from the popup. Neither version refreshed on a public profile view, account sync only copied Retail levels, and there is no background job.

Both versions now share apply_blizzard_profile: on a successful popup or profile fetch it updates bnet_level, bnet_last_login, class, race, spec, faction and bnet_id. It never writes played_s or the addon's level claim. A profile or manager view starts a rate-limited background refresh for characters not checked in the last 30 minutes (404s are remembered so under-10 Forever characters are not retried every visit; other failures are not stamped, so they can retry). Account sync also copies Forever listing levels. The visible card updates as soon as the popup has the new data, and the profile/gallery refetch a couple of seconds later so a first visit self-corrects after the background refresh.

No migration. Base: 0150679a from latest wow-played.

Live vs API (read-only, 11 November 2026, evening AEDT)

Public profile at playfraglink.com vs client-credentials GET of the character profile (profile-forever-us / profile-us). No live database writes and no use of Lucrona's account.

Character Live card Blizzard API API last login (AEDT)
Lucroner Ashborne (Forever, PvP, Paladin) 22 27 11 Nov 2026, 10:24:07 pm AEDT
Lucrona Ashborne (Forever, PvP, Warrior) 18 18 (current) 11 Nov 2026, 8:56:18 am AEDT
Lucroner Frostmourne (Retail, Paladin) 81 81 9 Nov 2026, 11:40:26 am AEDT
Lucrona Frostmourne (Retail, Warrior) 80 80 1 Nov 2026, 6:25:54 pm AEDT

Lucroena Ashborne (Forever) still 404s on the public profile (under 10). Sampled Retail characters currently match the API; the same write-back gap would have left Retail cards stale until a popup write or a /played upload check (6 hours).

After deploy

No migration. Existing stale cards self-correct without rewriting hours:

  • Opening the character popup writes the fresh level immediately and updates the visible card.
  • Loading the profile or View all starts a background refresh for anything not checked in 30 minutes. The first paint may still be stale; the page refetches the character list after 2.5 seconds, so the cards should catch up on that first visit. A reload after that also shows the new levels.

Validation

  • cargo fmt --all -- --check: passed.
  • cargo clippy -p fraglink-server -p fraglink-core -p fraglink-sync --all-targets -- -D warnings: passed.
  • JS UI tests (apps/site-web/tests/wow-*.cjs): 26 passed.
  • cargo test for those crates against box Postgres: all passed, including stale_blizzard_levels_update_cards_not_played (Retail 80→81 and Forever 22→27 on the cards, addon level and played_s unchanged; Forever account-sync copy to 28).

No merge or deployment performed.

The character popup already fetched a fresh profile, but Forever never
copied that level onto wow_characters.bnet_level, which is what the
profile and gallery cards read. Retail already wrote it from the popup.
Both versions now share that write-back (level, class, race, spec,
faction) without touching played_s or the addon's level claim.

A profile or manager view also refreshes characters not checked in the
last 30 minutes, account sync copies Forever levels as well as Retail,
and the cards update as soon as the popup (or a short profile refetch)
has the new data.
@Lucrona
Lucrona merged commit 037df6c into wow-played Nov 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant