fix(user): migrate lastReultHashes typo to lastResultHashes safely (@mukundangopalachary)#7830
Open
mukundangopalachary wants to merge 1 commit intomonkeytypegame:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a long-standing typo in the user document field used for duplicate-result detection, while keeping backward compatibility with existing MongoDB data.
Changes:
- Add correct
lastResultHashesalongside legacylastReultHashesin the sharedUserSchema. - Update backend write-path to write
lastResultHashesand unsetlastReultHashes. - Update backend read-path to fallback
lastResultHashes ?? lastReultHashes ?? []and exclude both from user response shaping.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/schemas/src/users.ts | Adds lastResultHashes while retaining legacy lastReultHashes for compatibility. |
| backend/src/dal/user.ts | Migrates writes to lastResultHashes and unsets legacy key during updates. |
| backend/src/api/controllers/user.ts | Ensures neither hash field is included in “relevant user info” responses. |
| backend/src/api/controllers/result.ts | Reads from corrected key first, then legacy, for duplicate detection. |
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
This PR fixes a typo in the user hashes field used for duplicate-result detection.
Problem:
lastReultHashes.Repro (before this change):
lastReultHashes(typo) instead oflastResultHashes.Approach:
lastResultHashes ?? lastReultHashes ?? []lastResultHashes.lastReultHashesduring updates.Checks
Closes #
Suggested PR title format (per their rule):