Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All changes that impact users of this module are documented in this file, in the [Common Changelog](https://common-changelog.org) format with some additional specifications defined in the CONTRIBUTING file. This codebase adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased [patch]

> Development of this release was made on a volunteer basis by Bhavy Singhal.

### Fixed
- Improve error message when history file is wrongly formatted as an object instead of an array

## 12.0.2 - 2026-05-26

> Development of this release was supported by [User Rights](https://www.user-rights.org).
Expand Down
3 changes: 3 additions & 0 deletions src/archivist/services/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ async function loadServiceHistoryFiles(serviceId) {
]);

Object.entries(serviceDeclaration.terms).forEach(([ termsType, declaration ]) => {
if (!Array.isArray(serviceHistory[termsType]) && serviceHistory[termsType] !== undefined) {
throw new Error(`History file for "${termsType}" is not properly formatted: expected an array but got an object. Please use [] instead of {}.`);
}
serviceHistory[termsType] = serviceHistory[termsType] || [];
serviceHistory[termsType].push(declaration);
});
Expand Down