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

Fix metadata/tagging undefined 500 error #239

Merged
merged 1 commit into from
Jan 10, 2024
Merged

Conversation

jatindersingh93
Copy link
Contributor

@jatindersingh93 jatindersingh93 commented Jan 5, 2024

This PR should fix the following error generated:

{"component":"app","level":"error","message":"Cannot read properties of undefined (reading 'metadata')","stack":"TypeError: Cannot read properties of undefined (reading 'metadata')\n    at /opt/app-root/src/app/src/services/metadata.js:213:36\n    at Array.map (<anonymous>)\n    at /opt/app-root/src/app/src/services/metadata.js:210:30\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async Object.fetchMetadata (/opt/app-root/src/app/src/controllers/object.js:624:24)","timestamp":"2024-01-05T21:25:44.042Z"}
{"azp":"bc-box-4555","httpVersion":"1.1","ip":"::ffff:10.97.65.112","level":"http","message":"GET /api/v1/object/metadata 500 97ms","method":"GET","path":"/api/v1/object/metadata","responseTime":97,"statusCode":500,"timestamp":"2024-01-05T21:25:44.043Z","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:121.0) Gecko/20100101 Firefox/121.0"}
{"contentLength":"225","httpVersion":"1.1","ip":"::ffff:10.97.137.99","level":"http","message":"GET / 200 0ms","method":"GET","path":"/","responseTime":0,"statusCode":200,"timestamp":"2024-01-05T21:25:44.256Z","userAgent":"Mozilla/5.0+(compatible; UptimeRobot/2.0; http://www.uptimerobot.com/)"}
{"component":"app","level":"error","message":"Cannot read properties of undefined (reading 'tag')","stack":"TypeError: Cannot read properties of undefined (reading 'tag')\n    at /opt/app-root/src/app/src/services/tag.js:264:34\n    at Array.map (<anonymous>)\n    at /opt/app-root/src/app/src/services/tag.js:261:30\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async Object.fetchTags (/opt/app-root/src/app/src/controllers/object.js:653:24)","timestamp":"2024-01-05T21:25:44.382Z"}
{"azp":"bc-box-4555","httpVersion":"1.1","ip":"::ffff:10.97.65.112","level":"http","message":"GET /api/v1/object/tagging 500 34ms","method":"GET","path":"/api/v1/object/tagging","responseTime":34,"statusCode":500,"timestamp":"2024-01-05T21:25:44.383Z","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:121.0) Gecko/20100101 Firefox/121.0"}

Description

Types of changes

Checklist

  • I have read the CONTRIBUTING doc
  • I have checked that unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

Copy link

codeclimate bot commented Jan 5, 2024

Code Climate has analyzed commit 72ec9a0 and detected 2 issues on this pull request.

Here's the issue category breakdown:

Category Count
Duplication 2

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 65.8% (0.0% change).

View more on Code Climate.

Copy link

github-actions bot commented Jan 5, 2024

Coverage Report

Totals Coverage
Statements: 59.13% ( 2781 / 4703 )
Methods: 49.61% ( 317 / 639 )
Lines: 65.81% ( 1671 / 2539 )
Branches: 52% ( 793 / 1525 )

@TimCsaky TimCsaky merged commit 0e0d49f into master Jan 10, 2024
15 of 16 checks passed
@TimCsaky TimCsaky deleted the Fix-metadata-error branch January 10, 2024 18:01
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.

None yet

4 participants