Skip to content

[T3477] Compassion Moment: recognize the real GMC 1S10 templates - #2220

Open
danpa32 wants to merge 2 commits into
18.0from
T3477-compassion-moment-1s10
Open

danpa32 wants to merge 2 commits into
18.0from
T3477-compassion-moment-1s10

Conversation

@danpa32

@danpa32 danpa32 commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The "B2S Compassion Moment" communication (child_letter_moment_config) was never used.

  1. sbc_compassion set is_compassion_moment only when the GMC template was exactly MX-C-1S10. GMC never sends that name: it puts the country before the code and a version after it (UG-C-1S10-2, MX-C-1S10-2, TG-G-1S10-1...). No letter was ever marked as a Compassion Moment.
  2. partner_communication_compassion send_communication decided "first letter" on all the letters of the batch, not on the letters of the partner. One first letter (new sponsor) in a batch gave the first-letter communication to every partner of the batch, and no Compassion Moment was used for them.

Changes

Commit 1: sbc_compassion, every 1S10 template is a Compassion Moment

  • json_to_data: is_compassion_moment is true when the template name contains -1S10-. Both families (XX-C-1S10-n and XX-G-1S10-n) are Compassion Moments.
  • An empty Template (None or "") falls back to our own template like a missing key, instead of crashing.
  • Tests with real template names received from GMC (UG-C-1S10-2, TG-G-1S10-1, MX-C-1S10-2, and non-1S10 ones).

Commit 2: partner_communication_compassion, first letter per partner

  • send_communication: is_first is computed on the letters of the partner in the loop.
  • Test: one batch with a first letter for partner A, a Compassion Moment for partner B and a normal letter for partner C. A gets the first-letter communication, B the Compassion Moment, C the normal new-letter communication.

Letters already received

No data change: their communication is already created or sent.

Tests

  • sbc_compassion: TestCompassionMoment
  • partner_communication_compassion: TestSendCommunication

Both test classes are post_install and need no demo data, so they also run on a copy of production without -u. Run on a copy of production: 4/4 pass. With the commit 2 change reverted, TestSendCommunication fails: partner B gets the first-letter communication instead of the Compassion Moment.

GMC never sends the template MX-C-1S10 alone: the name has the country
before and a version after (UG-C-1S10-2, TG-G-1S10-1...), so no letter
was ever marked as a Compassion Moment. Every template containing -1S10-
(C and G families) is now a Compassion Moment. An empty template falls
back to our own template instead of crashing.

Assisted-by: claude-opus-5-5, medium, claude-code
The first-letter check looked at all the letters of the batch: one new
sponsor's first letter gave the first-letter communication to every
partner of the batch, and no Compassion Moment was used.
@greptile-apps

greptile-apps Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This PR appears safe to merge.

Reviews (1) · Last reviewed commit: "[T3477] Letter communication: first lett..." · Reviewed by Greptile

@danpa32
danpa32 requested a review from ecino November 19, 2026 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant