Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: throw error if duplicate map #1082

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

jef
Copy link

@jef jef commented Dec 11, 2024

Closes #245

  • Tries to find if the hash of the .bsp is in the database. If it is, then it throws a ConflictException.

Screenshots (if applicable)

Checks

  • !! DONT IGNORE ME !! I have ran nx run db:create-migration <name> and committed the migration if I've made DB schema changes
  • I have included/updated tests where applicable (see Testing)
  • I have followed semantic commit messages e.g. feat: Add foo, chore: Update bar, etc...
  • My branch has a clear history of changes that can be easy to follow when being reviewed commit-by-commit
  • My branch is functionally complete; the only changes to be done will be those potentially requested in code review
  • All changes requested in review have been fixuped into my original commits

@jef jef marked this pull request as ready for review December 12, 2024 16:14
Copy link
Member

@tsa96 tsa96 left a comment

Choose a reason for hiding this comment

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

Thanks for first contribution! This check makes sense, though prefer .exists (see comments). Though we actually have two different endpoints that handle BSP uploads, the initial submission, and updated versions after then. So you need a check in MapsService.submitMapVersion as well, and E2E tests there as well.

The Volta thing I'm okay with, I'd been meaning to get round to pinning an Node version at some point anyway. Personally I'm using NVM but fine with switching.

apps/backend/src/app/modules/maps/maps.service.ts Outdated Show resolved Hide resolved
apps/backend/src/app/modules/maps/maps.service.spec.ts Outdated Show resolved Hide resolved
apps/backend/src/app/modules/maps/maps.service.ts Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
apps/backend/src/app/modules/maps/maps.service.spec.ts Outdated Show resolved Hide resolved
apps/backend/src/app/modules/maps/maps.service.spec.ts Outdated Show resolved Hide resolved
apps/backend/src/app/modules/maps/maps.service.ts Outdated Show resolved Hide resolved
@jef jef marked this pull request as draft December 12, 2024 21:32
@tsa96
Copy link
Member

tsa96 commented Dec 12, 2024

Something weird's happened with Git here - if you need a hand just ping me on Discord in #website!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hash the map on the backend and compare against other map hashes to prevent duplicate file uploading
2 participants