Repository navigation
[18.0][FIX] GMC incoming messages: intervention notifications, FCP notes, letters, per-message processing - #2214
Merged
Merged
Conversation
… and InterventionUpdate notifications - Amendment notification: read Intervention_ID from the unwrapped payload (json_to_data on the wrapped message never found it -> KeyError). - InterventionUpdateNotification (linked to UpdateInterventionDetailsRequest) only carries a summary: fetch the full kit with get_infos() instead of failing with 'No related objects found.' Assisted-by: claude-opus-5-5, medium, claude-code
Notes with RecordType ICP reference the FCP id in GlobalID, not a child: they failed with 'Associated object not found'. Post them in the chatter of the project instead.
…ved letter Raise an explicit error (supporter and beneficiary global ids) instead of KeyError 'sponsorship_id', e.g. when the sponsorship belongs to a company the GMC user can't access or the letter is addressed to a former correspondent.
A S2B letter created from a CommunicationUpdates message already has a kit identifier: sending it to translation failed with 'Letter already sent to GMC cannot be translated!' and creating its commkit again would send it twice.
… own savepoint Messages of a job were processed in one transaction: one failing message rolled back the whole batch and its error (and the merged object ids) were written on all messages. Each message now gets its own result.
[High impact] The PR appears safe to merge; no new blocking issues were found. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Incoming message batch] --> B[Next message]
B --> C[Run handler inside a savepoint]
C --> D{Handler raises an error?}
D -->|Yes| E[Roll back this message's changes]
E --> F[Save its failure details]
D -->|No| G[Save its result and related IDs]
F --> H{More messages?}
G --> H
H -->|Yes| B
H -->|No| I[Finish batch]
C -->|Retryable database conflict| J[Raise for job retry]
Reviews (3) · Last reviewed commit: "Merge branch '18.0' into fix-gmc-incomin..." · Reviewed by Greptile |
The message of an FCP note referenced the project id while its action targets compassion.child.note: 'related objects' opened an unrelated child note. FCP notes are now compassion.child.note records with a project_id (child_id no longer required). Assisted-by: claude-opus-5-5, medium, claude-code
Member
|
👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes for incoming GMC messages found while going through the failed messages in production.
Changes
InterventionAmendmentCommitmentNotification:KeyError: 'intervention_id'.json_to_datawas called on the payload still wrapped in the message name, so the mapping never foundIntervention_ID. The id is now read from the unwrapped payload.InterventionUpdateNotification: this schema is linked toUpdateInterventionDetailsRequest, but the handler only readInterventionDetailsRequest/InterventionAmendmentKitRequest, so these messages failed with "No related objects found.". The notification only carries a summary, so the full kit is now fetched withget_infos().NotesKitwithRecordType: ICPreferences the FCP id inGlobalID, not a child, and failed with "Associated object not found". These notes are now posted in the chatter of the project.KeyError: 'sponsorship_id'. In production this happened when the sponsorship belonged to a company the GMC user couldn't access (PL), and for letters addressed to a former correspondent.dispatch_s2b_lettersskips S2B letters that already have akit_identifier. A letter created from aCommunicationUpdatesmessage failed with "Letter already sent to GMC cannot be translated!", and creating its commkit again would have sent it twice.object_idswere written on every message of the batch.Tests
sbc_translationchanges were linted (ruff, ruff-format, pylint-odoo) but not run.🤖 Generated with Claude Code