Skip to content

Commit 37e003f

Browse files
committed
Improve function name and comments
1 parent 3303593 commit 37e003f

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/archivist/index.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,7 @@ export default class Archivist extends events.EventEmitter {
160160
if (!technicalUpgradeOnly) {
161161
await this.fetchAndRecordSnapshots(terms);
162162
} else {
163-
// In technical upgrade mode, fetch and record snapshots only for new source documents
164-
// that don't have existing snapshots yet (e.g., when a declaration is updated to add a new source document)
165-
await this.fetchAndRecordMissingSnapshots(terms);
163+
await this.fetchAndRecordNewSourceDocuments(terms); // In technical upgrade mode, fetch and record snapshots only for new source documents that don't have existing snapshots yet (e.g., when a declaration is updated to add a new source document)
166164
}
167165

168166
const contents = await this.extractContentsFromSnapshots(terms);
@@ -194,14 +192,14 @@ export default class Archivist extends events.EventEmitter {
194192
}
195193
}
196194

197-
async fetchAndRecordMissingSnapshots(terms) {
195+
async fetchAndRecordNewSourceDocuments(terms) {
198196
if (!terms.hasMultipleSourceDocuments) { // If the terms has only one source document, there is nothing to do
199197
return;
200198
}
201199

202200
const existingVersion = await this.recorder.versionsRepository.findLatest(terms.service.id, terms.type);
203201

204-
if (!existingVersion) { // If the terms already has a version recorded, skip this step as the next version will be tagged as "First record…" anyway
202+
if (!existingVersion) { // If the terms does not have a version recorded, skip this step as the next version will be tagged as "First record…" anyway
205203
return;
206204
}
207205

src/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ export default async function track({ services, types, technicalUpgradeOnly, sch
4242

4343
// Technical upgrade pass: apply changes from engine, dependency, or declaration upgrades.
4444
// This regenerates versions from existing snapshots with updated extraction logic.
45-
// For terms with combined source documents, if a new document was added to the declaration,
46-
// it will be fetched and combined with existing snapshots to regenerate the complete version.
45+
// For terms with combined source documents, if a new document was added to the declaration, it will be fetched and combined with existing snapshots to regenerate the complete version.
4746
// All versions from this pass are labeled as technical upgrades to avoid false notifications about content changes.
4847
await archivist.track({ services, types, technicalUpgradeOnly: true });
4948

0 commit comments

Comments
 (0)