diff --git a/CHANGELOG.md b/CHANGELOG.md index 83b148ed9..b5ce6f4b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ 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 supported by the [European Commission](https://commission.europa.eu/) for its [VLOPs/VLOSEs instance](https://code.europa.eu/dsa/terms-and-conditions-database/vlops-and-vloses/). + +### Fixed + +- Fix tracking when proxy configuration is provided + ## 9.2.0 - 2025-11-05 _Full changeset and discussions: [#1173](https://github.com/OpenTermsArchive/engine/pull/1173)._ diff --git a/src/archivist/fetcher/htmlOnlyFetcher.js b/src/archivist/fetcher/htmlOnlyFetcher.js index e3e581c44..2a25f28c6 100644 --- a/src/archivist/fetcher/htmlOnlyFetcher.js +++ b/src/archivist/fetcher/htmlOnlyFetcher.js @@ -1,7 +1,7 @@ import AbortController from 'abort-controller'; import convertBody from 'fetch-charset-detection'; // eslint-disable-line import/no-unresolved -import HttpProxyAgent from 'http-proxy-agent'; -import HttpsProxyAgent from 'https-proxy-agent'; +import { HttpProxyAgent } from 'http-proxy-agent'; +import { HttpsProxyAgent } from 'https-proxy-agent'; import nodeFetch, { AbortError } from 'node-fetch'; import { resolveProxyConfiguration } from './proxyUtils.js'; diff --git a/src/archivist/recorder/index.js b/src/archivist/recorder/index.js index eb65e0632..c532d5cc9 100644 --- a/src/archivist/recorder/index.js +++ b/src/archivist/recorder/index.js @@ -12,8 +12,11 @@ export default class Recorder { return Promise.all([ this.versionsRepository.initialize(), this.snapshotsRepository.initialize() ]); } - finalize() { - return Promise.all([ this.versionsRepository.finalize(), this.snapshotsRepository.finalize() ]); + async finalize() { + // Close repositories sequentially to avoid race conditions when both repositories use the same MongoDB connection (same server/database). + // Parallel closing can cause "Operation interrupted because client was closed" errors, especially on Windows. + await this.versionsRepository.finalize(); + await this.snapshotsRepository.finalize(); } getLatestSnapshot(terms, sourceDocumentId) {