Skip to content

Commit f556653

Browse files
committed
bugfix/progress report showing inaccurate current scores
1 parent 100f0b5 commit f556653

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

services/progress-report/src/notify/notify-send-org-progress-report.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ const sendOrgProgressReport = async ({ log, user, orgStats, notifyClient }) => {
1111
org_name_en: orgDetails.en.name,
1212
org_name_fr: orgDetails.fr.name,
1313
https_score: `${httpsScore}%`,
14-
https_score_diff: httpsScoreDiff > 0 ? `+${httpsScoreDiff}%` : `${httpsScoreDiff}%`,
14+
https_score_diff: httpsScoreDiff >= 0 ? `+${httpsScoreDiff}%` : `${httpsScoreDiff}%`,
1515
dmarc_score: `${dmarcScore}%`,
16-
dmarc_score_diff: dmarcScoreDiff > 0 ? `+${dmarcScoreDiff}%` : `${dmarcScoreDiff}%`,
16+
dmarc_score_diff: dmarcScoreDiff >= 0 ? `+${dmarcScoreDiff}%` : `${dmarcScoreDiff}%`,
1717
domain_count: domainCount,
18-
domain_count_diff: domainCountDiff > 0 ? `+${domainCountDiff}` : domainCountDiff,
18+
domain_count_diff: domainCountDiff >= 0 ? `+${domainCountDiff}` : domainCountDiff,
1919
},
2020
})
2121
log(`Successfully sent ${orgDetails.en.name} progress report via email to user:, ${user._key}`)

services/progress-report/src/progress-report-service.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ const calculateSummaryStats = ({ startSummary, endSummary }) => {
6464
const domainCountDiff = endSummary.dmarc.total - startSummary.dmarc.total
6565

6666
return {
67-
httpsScore: endHttpsScore.toFixed(1) * 100,
68-
dmarcScore: endDmarcScore.toFixed(1) * 100,
67+
httpsScore: (endHttpsScore * 100).toFixed(1),
68+
dmarcScore: (endDmarcScore * 100).toFixed(1),
6969
domainCount: endSummary.dmarc.total,
7070
httpsScoreDiff: httpsScoreDiff.toFixed(1),
7171
dmarcScoreDiff: dmarcScoreDiff.toFixed(1),

0 commit comments

Comments
 (0)