Skip to content

894 bug battlestart returns 500 when custom matchid is not a mongo objectid - #898

Merged
CapoMK25 merged 4 commits into
devfrom
894-bug-battlestart-returns-500-when-custom-matchid-is-not-a-mongo-objectid
Aug 7, 2026
Merged

894 bug battlestart returns 500 when custom matchid is not a mongo objectid#898
CapoMK25 merged 4 commits into
devfrom
894-bug-battlestart-returns-500-when-custom-matchid-is-not-a-mongo-objectid

Conversation

@tickBit

@tickBit tickBit commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Brief description

There used to be allowed in the startBattle.dto.ts @IsString custom matchId, but using custom string caused 500 internal server error. To accept custom string without 500 internal server error requires changes to database schema.

Now matchId field must be MongoDB style string. It can be custom string with if it's also a 24 byte MongoDB string at the same time.

I git stashed the prettier/linting changes of other files.

Issue #894

Change list

  • startBattle.dto.ts (require MongoID for matchId)
  • added new test file for startBattle.dto.ts

@codecov-alt

codecov-alt Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
see 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@CapoMK25 CapoMK25 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Solid, approved. Be wary in the future with ObjectID vs string mismatches just in case, this PR/issue combo won't likely introduce them, but they're a common pain point in unit testing on bigger issues regardless.

@github-project-automation github-project-automation Bot moved this from Backlog to Done in Altzone-Server Aug 7, 2026
@CapoMK25
CapoMK25 merged commit ba3ac26 into dev Aug 7, 2026
5 checks passed
@CapoMK25
CapoMK25 deleted the 894-bug-battlestart-returns-500-when-custom-matchid-is-not-a-mongo-objectid branch August 7, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Bug: /battle/start returns 500 when custom matchId is not a Mongo ObjectId

2 participants