Skip to content

fix(user): migrate lastReultHashes to lastResultHashes safely (@Tryhard-source)#8055

Open
Tryhard-source wants to merge 9 commits into
monkeytypegame:masterfrom
Tryhard-source:fix-lastresulthashes-typo
Open

fix(user): migrate lastReultHashes to lastResultHashes safely (@Tryhard-source)#8055
Tryhard-source wants to merge 9 commits into
monkeytypegame:masterfrom
Tryhard-source:fix-lastresulthashes-typo

Conversation

@Tryhard-source
Copy link
Copy Markdown

Implements the changes requested in #7830.

This PR migrates the legacy lastReultHashes field to lastResultHashes using a soft migration approach to avoid requiring a full database migration.

Changes:

  • Add lastResultHashes to DBUser
  • Keep legacy lastReultHashes for backward compatibility
  • Read from lastResultHashes ?? lastReultHashes ?? []
  • Write to lastResultHashes
  • Unset lastReultHashes on update
  • Add migration logic in migrateUser

This ensures existing user data remains compatible while gradually moving to the corrected schema.

Related issues:

@monkeytypegeorge monkeytypegeorge added backend Server stuff api A change to the Application Programming Interface (API) labels Jun 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

Continuous integration check(s) failed. Please review the failing check's logs and make the necessary changes.

@github-actions github-actions Bot added the waiting for update Pull requests or issues that require changes/comments before continuing label Jun 4, 2026
@monkeytypegeorge monkeytypegeorge added the docs Related to Markdown files and documentation label Jun 4, 2026
@github-actions github-actions Bot removed the waiting for update Pull requests or issues that require changes/comments before continuing label Jun 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

Continuous integration check(s) failed. Please review the failing check's logs and make the necessary changes.

@github-actions github-actions Bot added the waiting for update Pull requests or issues that require changes/comments before continuing label Jun 4, 2026
@github-actions github-actions Bot removed the waiting for update Pull requests or issues that require changes/comments before continuing label Jun 4, 2026
@xNoerPlaysCodes
Copy link
Copy Markdown

I'm not a maintainer or a contributor but fwiw this LGTM.

Comment thread backend/src/api/controllers/user.ts
Comment thread backend/src/api/controllers/user.ts
Comment thread backend/src/dal/user.ts
Comment thread backend/src/dal/user.ts Outdated
Copy link
Copy Markdown
Member

@fehmer fehmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @Tryhard-source,

please revert the unrelated changes in the markdown files.

@github-actions github-actions Bot added the waiting for update Pull requests or issues that require changes/comments before continuing label Jun 4, 2026
…TypeScript mismatch during migration. All checks passing locally.
@github-actions github-actions Bot removed the waiting for update Pull requests or issues that require changes/comments before continuing label Jun 4, 2026
@socket-security
Copy link
Copy Markdown

socket-security Bot commented Jun 4, 2026

No dependency changes detected. Learn more about Socket for GitHub.

👍 No dependency changes detected in pull request

@monkeytypegeorge monkeytypegeorge removed the docs Related to Markdown files and documentation label Jun 4, 2026
@Tryhard-source
Copy link
Copy Markdown
Author

Tryhard-source commented Jun 4, 2026

hi @Tryhard-source,

please revert the unrelated changes in the markdown files.

Cleaned up the PR changes... there were some unintended formatting changes. (likely from Prettier)

I’ve reverted those and reduced the diff to only the intended backend change (fixing lastResultHashes typo + migrating legacy field). The PR now contains only the relevant changes. Thanks!

@Tryhard-source Tryhard-source requested a review from fehmer June 5, 2026 04:49
@github-actions github-actions Bot added the waiting for review Pull requests that require a review before continuing label Jun 5, 2026
Copy link
Copy Markdown
Member

@fehmer fehmer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check all my comments from the first review

@github-actions github-actions Bot removed the waiting for review Pull requests that require a review before continuing label Jun 5, 2026
@github-actions github-actions Bot added the waiting for update Pull requests or issues that require changes/comments before continuing label Jun 5, 2026
@github-actions github-actions Bot removed the waiting for update Pull requests or issues that require changes/comments before continuing label Jun 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

Continuous integration check(s) failed. Please review the failing check's logs and make the necessary changes.

@github-actions github-actions Bot added the waiting for update Pull requests or issues that require changes/comments before continuing label Jun 5, 2026
@github-actions github-actions Bot removed the waiting for update Pull requests or issues that require changes/comments before continuing label Jun 5, 2026
@Tryhard-source Tryhard-source requested a review from fehmer June 5, 2026 09:06
@Tryhard-source
Copy link
Copy Markdown
Author

Addressed the remaining review comments and fixed the lint issue.

@github-actions github-actions Bot added the waiting for review Pull requests that require a review before continuing label Jun 5, 2026
@monkeytypegeorge monkeytypegeorge added the packages Changes in local packages label Jun 5, 2026
@fehmer
Copy link
Copy Markdown
Member

fehmer commented Jun 5, 2026

hi @Tryhard-source ,

i removed the last usage of the old property with the typo and both properties from the user response, please have a look.

@Tryhard-source
Copy link
Copy Markdown
Author

@fehmer Looks good to me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api A change to the Application Programming Interface (API) backend Server stuff packages Changes in local packages waiting for review Pull requests that require a review before continuing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants