Skip to content

Commit 75415dc

Browse files
nits
1 parent 6bb845f commit 75415dc

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

Diff for: src/oneTrust/helpers/syncOneTrustAssessmentToDisk.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export const syncOneTrustAssessmentToDisk = ({
4646
assessment,
4747
index,
4848
total,
49+
wrap: false,
4950
}),
5051
);
5152
} else {
@@ -55,7 +56,7 @@ export const syncOneTrustAssessmentToDisk = ({
5556
assessment,
5657
index,
5758
total,
58-
}),
59+
wrap: false, }),
5960
);
6061
}
6162
} else if (fileFormat === OneTrustFileFormat.Csv) {

Diff for: src/oneTrust/helpers/syncOneTrustAssessmentToTranscend.ts

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ export const syncOneTrustAssessmentToTranscend = async ({
4848
assessment,
4949
index,
5050
total,
51-
wrap: true,
5251
});
5352

5453
// transform the csv record into a valid input to the mutation

Diff for: src/oneTrust/helpers/syncOneTrustAssessments.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const syncOneTrustAssessments = async ({
5050
logger.info('Getting list of all assessments from OneTrust...');
5151
const assessments = await getListOfOneTrustAssessments({ oneTrust });
5252

53-
// a cache of OneTrust users so we avoid sending requests for users already fetched
53+
// a cache of OneTrust users so we avoid requesting already fetched users
5454
const oneTrustCachedUsers: Record<string, OneTrustGetUserResponse> = {};
5555

5656
// split all assessments in batches, so we can process some of steps in parallel
@@ -115,7 +115,7 @@ export const syncOneTrustAssessments = async ({
115115

116116
// fetch assessment internal respondents information
117117
const { respondents } = assessmentDetails;
118-
// internal respondents names are not emails.
118+
// if a user is an internal respondents, their 'name' field can't be an email.
119119
const internalRespondents = respondents.filter(
120120
(r) => !r.name.includes('@'),
121121
);
@@ -179,12 +179,14 @@ export const syncOneTrustAssessments = async ({
179179
await mapSeries(
180180
batchEnrichedAssessments,
181181
async (enrichedAssessment, index) => {
182-
const trueIndex = batch * BATCH_SIZE + index;
182+
// the assessment's global index takes its batch into consideration
183+
const globalIndex = batch * BATCH_SIZE + index;
184+
183185
if (dryRun && file && fileFormat) {
184186
// sync to file
185187
syncOneTrustAssessmentToDisk({
186188
assessment: enrichedAssessment,
187-
index: trueIndex,
189+
index: globalIndex,
188190
total: assessments.length,
189191
file,
190192
fileFormat,
@@ -195,7 +197,7 @@ export const syncOneTrustAssessments = async ({
195197
assessment: enrichedAssessment,
196198
transcend,
197199
total: assessments.length,
198-
index: trueIndex,
200+
index: globalIndex,
199201
});
200202
}
201203
},

0 commit comments

Comments
 (0)