blurts-server icon indicating copy to clipboard operation
blurts-server copied to clipboard

MNTOR-4448: merge dup subscriber script

Open mansaj opened this issue 7 months ago • 1 comments

References:

Jira: MNTOR-4448

Description

This script is meant to be run as a one-off job that needs to be run in a pod. It implements the cohort-based strategy for merging duplicate subscriber entries where multiple subscribers share the same fxa_uid. The script:

    1. Identifies all duplicate fxa_uids
    1. Categorizes them into 4 cohorts based on paid status and activity
    1. Processes each cohort with appropriate merge logic
    1. Updates related tables to point to the winning subscriber record
    1. Performs all operations in transactions with logging

How to test

See additional testing doc / explaination

Checklist (Definition of Done)

  • [x] Commits in this PR are minimal and have descriptive commit messages.
  • [x] I've added or updated the relevant sections in readme and/or code comments
  • [x] I've added a unit test to test for potential regressions of this bug.
  • [x] Product Owner accepted the User Story (demo of functionality completed) or waived the privilege.
  • [x] All acceptance criteria are met.
  • [x] Jira ticket has been updated (if needed) to match changes made during the development process.
  • [x] Jira ticket has been updated (if needed) with suggestions for QA when this PR is deployed to stage.

mansaj avatar May 19 '25 18:05 mansaj

Preview URL :rocket: : https://blurts-server-pr-5907-mgjlpikfea-uk.a.run.app

github-actions[bot] avatar May 19 '25 19:05 github-actions[bot]