IQSS / IQSS/dataverse-client-javascript

Inconsistency in `DatasetVersionInfo` model? (Date vs string)

Open Beginner friendly
#476 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
20
Forks
11
Avg merge
2d 5h
Merged PRs (30d)
1

Description

I noticed that in the DatasetVersionInfo model, the timestamps use inconsistent types:

https://github.com/IQSS/dataverse-client-javascript/blob/0043dddf5e7d9358d0dcac176cb8c0f325aab78b/src/datasets/domain/models/Dataset.ts#L25-L32

releaseTime and createTime are represented as Date objects, while lastUpdateTime is represented as an ISO 8601 string and not transformed into a Date object:

https://github.com/IQSS/dataverse-client-javascript/blob/0043dddf5e7d9358d0dcac176cb8c0f325aab78b/src/datasets/infra/repositories/transformers/datasetTransformers.ts#L237-L239

The return values from the Dataverse API for retrieving a dataset version are all consistently ISO 8601 strings:

Image

I was wondering what the reason for this is, or whether this inconsistency should be cleaned up? (If so, I'd be open to opening a PR for that)

Contributor guide

Open the contributing guide

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.

Research direction

Start with the referenced DatasetVersionInfo definition in src/datasets/domain/models/Dataset.ts and the transformation in src/datasets/infra/repositories/transformers/datasetTransformers.ts. Compare how releaseTime, createTime, and lastUpdateTime are represented against the Dataverse API response. Done means the model and transformer use a deliberate, consistent timestamp representation for all three fields.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend-api-design
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.