`parserVersion.get()` crashes when HTTP metadata lacks `metadata.versioning.release` field

Open Beginner friendly
#1,359 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript
Domain
cli

Research direction

Start with src/parser-version.js and the parserVersion.get() entry point, then reproduce a successful metadata response missing metadata.versioning.release or using an unexpected XML shape. Trace how the parsed value is assigned and cached. Done means the incomplete document produces a controlled diagnostic identifying the invalid metadata without poisoning the cached version value.

Written by the indexing model from the issue text.

Description

bug good-title

Steps to reproduce

  1. Make Maven Central return a successful metadata document that lacks metadata.versioning.release or uses an unexpected XML shape.
  2. Call parserVersion.get().

Actual result

The code dereferences xml.metadata.versioning.release without validating the parsed structure and raises a raw TypeError. The CLI does not report which metadata field is missing or offer a fallback.

Expected result

A successful but incomplete metadata response should produce a controlled diagnostic that identifies the invalid document, without poisoning the cached version value.

Evidence

src/parser-version.js assigns version.value = xml.metadata.versioning.release immediately after checking only the HTTP status code.

Dominant language
JavaScript
Stars
36
Forks
64
Avg merge
1d 14h
Merged PRs (30d)
17

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from objectionary/eoc

All issues in objectionary/eoc

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.