Repository navigation
Conversation
A player save replaced the whole document, guildId included, with what it read before waiting on Hypixel. A guild refresh that set or unset the player's guildId in that window was overwritten, and later refreshes reuse the cached member's guildId, so it could stay wrong for up to a day. - Save with one pipeline update: the document replaceOne would store, with the guildId that's stored when the write lands. Only guild refreshes write guildId now - Keep the __v: 0 that Mongoose's replaceOne adds to every replacement, so stored documents don't change - Run apps/api's in-source tests, for a snapshot of the update
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This was referenced Oct 21, 2026
Mongoose's replaceOne added __v: 0 to every player it saved, and the guildId-keeping update hard-coded it to match. Nothing reads __v, so the Player schema now turns the version key off and the update leaves it out. Players saved from now on have no __v; existing ones keep theirs until their next save. Session extends Player and would inherit the setting, so the session model turns its version key back on and session documents don't change. Guilds have their own schema and don't change either.
Session extends Player and inherits its schema options, so it now has no version key either. Session resets from now on store no __v; existing sessions keep theirs until they're reset. Nothing reads it.
|
Deployment failed for project statsify with the following error: Learn More: https://vercel.com/statsify-net?upgradeToPro=build-rate-limit |
# Conflicts: # apps/api/src/player/player.service.ts
This branch was previously 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 player save wrote back the guildId it read before waiting on Hypixel, so a guild refresh that landed in between got undone.
Merge order for the perf PRs is in #1002.
Testing: save a player and a session here and on #1005. The stored documents only differ by the missing __v.
Depends on #1005