Repository navigation
Write Blizzard levels from the popup back onto WoW cards - #40
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_levelfromwow_characters(bnet_levelwhen it is newer than the last /played upload; otherwise the addon'slevel).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 updatesbnet_level,bnet_last_login, class, race, spec, faction andbnet_id. It never writesplayed_sor the addon'slevelclaim. 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:
0150679afrom latest wow-played.Live vs API (read-only, 11 November 2026, evening AEDT)
Public profile at playfraglink.com vs client-credentials
GETof the character profile (profile-forever-us/profile-us). No live database writes and no use of Lucrona's account.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:
Validation
cargo fmt --all -- --check: passed.cargo clippy -p fraglink-server -p fraglink-core -p fraglink-sync --all-targets -- -D warnings: passed.apps/site-web/tests/wow-*.cjs): 26 passed.cargo testfor those crates against box Postgres: all passed, includingstale_blizzard_levels_update_cards_not_played(Retail 80→81 and Forever 22→27 on the cards, addonlevelandplayed_sunchanged; Forever account-sync copy to 28).No merge or deployment performed.