Repository navigation
Conversation
A cached skin was used for 3 hours; after that, the next request waited for Mojang's session server before it could draw a head or a render. Every player seen again after 3 hours cost a Mojang call, and the session server rate limits by address. A cached skin is now always served at once. Once it's a day old, the request that finds it starts a refresh in the background, and the next request gets the new skin. Requests that arrive while a refresh is running share it, so a stale skin costs one call however many heads are drawn. A failed refresh keeps the cached skin and is tried again after an hour. It only moves the skin's refresh time, so it can't write an older copy back over anything saved meanwhile, such as the usernameToLower backfill. A player with no cached skin still waits for Mojang, as before. This drops getSkin's fallback to the cached skin when the session server fails, along with its check that a skin found by name belongs to the uuid Mojang gave for that name. No request path falls back anymore: a cached skin is served before Mojang is asked, and its refresh asks for the skin's own uuid. save() replaces the document with the skin's own uuid, so it can't hit the duplicate key error (E11000) that the check guarded against. After a rename, a lookup by the name can still serve the previous owner's skin until that copy is refreshed; from then on the name finds the new owner.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
Deployment failed for project statsify with the following error: Learn More: https://vercel.com/docs/limits#rate-limits |
# Conflicts: # apps/api/src/skin/skin.service.ts
This branch has not been deployed
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.
Description: A skin expired after three hours, and the next request waited on Mojang's session server, which rate limits by address.
After #1011 squash-merges, rebase with
git rebase --onto origin/main f811f3cb fix/skin-background-refresh.Testing: set a skin's
expiresAtto 0 and request/skin/head?uuid=<uuid>. It comes back right away, and itsexpiresAtmoves a day out.Depends on #1011