fix(cohort): make Brevo cohort membership sync additive-only#370
Closed
jorisjonkers-dev-agents[bot] wants to merge 1 commit into
Closed
fix(cohort): make Brevo cohort membership sync additive-only#370jorisjonkers-dev-agents[bot] wants to merge 1 commit into
jorisjonkers-dev-agents[bot] wants to merge 1 commit into
Conversation
1820573 to
6bf3103
Compare
Keep rule-driven cohort departures local-only while preserving additive membership sync and explicit drift remediation removals.
6bf3103 to
e4aa966
Compare
Contributor
Author
|
Closing: the additive-only guardrail is not wanted — manual deletion stays available and automatic removal may be desired in future, and the reconcile that triggered the incident is already a manual operation. Removal behavior reverts to the prior (additive + removal) model. |
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.
Summary
Cohort membership sync removed members from Brevo lists automatically: when a user dropped out of a cohort's desired set, rule evaluation enqueued a
SyncCohortMembership(REMOVE)that called the provider'sremoveMember. A bad desired-set shrink (a rule or fact-collection error, or a bulk change) could therefore strip real entries from Brevo lists.Automatic removal from Brevo lists is now blocked:
SyncCohortMembership(REMOVE)on a desired-set shrink. The localcohort_memberrow is still soft-deleted, and ADDs are unchanged. A member that should no longer be present simply remains in the Brevo list and is surfaced as a remote extra by the existing reconcile/drift path for explicit review.CohortMemberRemovalPolicyblocks an automatic BrevoremoveMemberbefore it reaches the provider, so the path cannot be reintroduced accidentally.EXPLICIT_OPERATORand still callsremoveMember.deleteCohortis unchanged and remains reachable only from explicit target switch / delete-target handling, never from rule evaluation or reconcile. Contact and calendar deletion are out of scope.Stacked on the cohort incident fix (#369).
Verification
./gradlew :services:api:compileKotlin :services:api:compileTestKotlin :services:api:test --tests "*cohort*"— 111 passed