Skip to content

890 bug get itemsteal returns 500 internal server error if no request body is provided - #891

Merged
tickBit merged 2 commits into
devfrom
890-bug-get-itemsteal-returns-500-internal-server-error-if-no-request-body-is-provided
Aug 5, 2026
Merged

890 bug get itemsteal returns 500 internal server error if no request body is provided#891
tickBit merged 2 commits into
devfrom
890-bug-get-itemsteal-returns-500-internal-server-error-if-no-request-body-is-provided

Conversation

@constf03

@constf03 constf03 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Brief description

This PR should fix a bug with endpoint GET /item/steal where it returns internal server error if no request body is provided instead of throwing unauthorized API Error like was intended to do.

Change list

  • updated src/clanInventory/item/guards/StealToken.guard.ts

    • check that request.body.steal_token or request.query.steal_token is not undefined before accessing stealToken (avoid TypeError that caused internal server error)
  • updated src/__tests__/clanInventory/item/guards/AuthGuard/canActivate.test.ts

    • added a new test that checks if Unauthorized APIError is thrown if no request body is provided

@codecov-alt

codecov-alt Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/clanInventory/item/guards/StealToken.guard.ts 100.00% <100.00%> (ø)

... and 2 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.

@tickBit tickBit 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.

Clean and good job! Approved.

@github-project-automation github-project-automation Bot moved this from Backlog to Done in Altzone-Server Aug 5, 2026
@tickBit
tickBit merged commit 766c199 into dev Aug 5, 2026
5 checks passed
@tickBit
tickBit deleted the 890-bug-get-itemsteal-returns-500-internal-server-error-if-no-request-body-is-provided branch August 5, 2026 10:26
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: GET /item/steal returns 500 internal server error, if no request body is provided

2 participants