Skip to content

Commit b8544ea

Browse files
committed
PM-5409: Hide example scores from scoring emails
What was broken Members received marathon match scoring-completion emails that included the relative example score alongside the provisional score. Root cause The submission scoring completion payload exposed aggregateExampleScore to the SendGrid email template data. What was changed Removed aggregateExampleScore from the submission scoring completion details and Bus email payload while keeping example scoring completion as part of the readiness and pass/fail status check. Updated the notification payload documentation to list only the provisional score for submission-phase emails. Any added/updated tests Updated scoring completion email and scoring result service specs to verify the submission email payload omits aggregateExampleScore and still includes aggregateProvisionalScore.
1 parent 5db9157 commit b8544ea

5 files changed

Lines changed: 4 additions & 10 deletions

docs/marathon-processor-specification-and-scoring-terminology.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,6 @@ Both email payloads include:
335335

336336
The Example/Provisional completion payload also includes:
337337

338-
- aggregate example score after relative scoring updates
339338
- aggregate provisional score after relative scoring updates
340339

341340
The System completion payload also includes:

src/api/scoring-result/scoring-completion-email.service.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ describe('ScoringCompletionEmailService', () => {
1616
};
1717

1818
const details = {
19-
aggregateExampleScore: 95.25,
2019
aggregateProvisionalScore: 87.5,
2120
challengeId: '76d6e4b8-1cca-4850-8bc5-bdaddfece87a',
2221
challengeName: 'Blocks',
@@ -112,7 +111,6 @@ describe('ScoringCompletionEmailService', () => {
112111
recipients: ['competitor@example.com'],
113112
sendgrid_template_id: 'sendgrid-template-id',
114113
data: expect.objectContaining({
115-
aggregateExampleScore: details.aggregateExampleScore,
116114
aggregateProvisionalScore: details.aggregateProvisionalScore,
117115
challengeId: details.challengeId,
118116
challengeName: details.challengeName,
@@ -131,6 +129,8 @@ describe('ScoringCompletionEmailService', () => {
131129
}),
132130
}),
133131
);
132+
const sentPayload = httpService.post.mock.calls[0][1].payload.data;
133+
expect(sentPayload.aggregateExampleScore).toBeUndefined();
134134
expect(prisma.$executeRaw).toHaveBeenCalledTimes(1);
135135
});
136136

src/api/scoring-result/scoring-completion-email.service.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export interface SubmissionScoringCompletionEmailDetails {
1515
memberId?: string;
1616
userId?: string;
1717
scoringStatus: ScoringCompletionStatus;
18-
aggregateExampleScore: number;
1918
aggregateProvisionalScore: number;
2019
}
2120

@@ -78,7 +77,7 @@ export class ScoringCompletionEmailService {
7877
* Sends the completion email if the template is configured and this
7978
* submission has not already produced a successful notification.
8079
* @param token M2M token used for member-api-v6 and Bus API calls.
81-
* @param details Submission, challenge, member, and score values for the email.
80+
* @param details Submission, challenge, member, status, and provisional score values for the email.
8281
* @returns Resolves after the email is sent, skipped, or marked failed.
8382
*/
8483
async sendSubmissionScoringCompleteEmail(
@@ -460,7 +459,7 @@ export class ScoringCompletionEmailService {
460459

461460
/**
462461
* Builds the email payload expected by the `external.action.email` topic.
463-
* @param details Submission, challenge, member, and score values.
462+
* @param details Submission, challenge, member, status, and provisional score values.
464463
* @param recipientEmail Email address to receive the notification.
465464
* @param memberHandle Resolved member handle for template data.
466465
* @param sendgridTemplateId SendGrid dynamic template ID.
@@ -487,7 +486,6 @@ export class ScoringCompletionEmailService {
487486
challengeUrl,
488487
challengeURL: challengeUrl,
489488
scoringStatus: details.scoringStatus,
490-
aggregateExampleScore: details.aggregateExampleScore,
491489
aggregateProvisionalScore: details.aggregateProvisionalScore,
492490
},
493491
sendgrid_template_id: sendgridTemplateId,

src/api/scoring-result/scoring-result.service.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,6 @@ describe('ScoringResultService', () => {
727727
expect(
728728
scoringCompletionEmailService.sendSubmissionScoringCompleteEmail,
729729
).toHaveBeenCalledWith('m2m-token', {
730-
aggregateExampleScore: 96,
731730
aggregateProvisionalScore: 88,
732731
challengeId: basePayload.challengeId,
733732
challengeName: 'Marathon Match 2026 Beta Test',
@@ -908,7 +907,6 @@ describe('ScoringResultService', () => {
908907
).toHaveBeenCalledWith(
909908
'm2m-token',
910909
expect.objectContaining({
911-
aggregateExampleScore: 96,
912910
aggregateProvisionalScore: -1,
913911
scoringStatus: 'fail',
914912
}),

src/api/scoring-result/scoring-result.service.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1353,7 +1353,6 @@ export class ScoringResultService {
13531353
exampleResult.status === 'pass' && provisionalResult.status === 'pass'
13541354
? 'pass'
13551355
: 'fail',
1356-
aggregateExampleScore: exampleResult.aggregateScore,
13571356
aggregateProvisionalScore: provisionalResult.aggregateScore,
13581357
};
13591358
}

0 commit comments

Comments
 (0)