-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework msgs database triggers so we don't track counts for messages in archives #3691
Conversation
@@ -769,30 +752,6 @@ BEGIN | |||
RAISE EXCEPTION 'Cannot change created_on on messages'; | |||
END IF; | |||
|
|||
-- Clean up counts when we are doing a real delete |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's never a scenario now where we distinguish between an archiver delete and a "real" delete. the msg existed so it stays in channel counts
Codecov Report
@@ Coverage Diff @@
## main #3691 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 484 485 +1
Lines 26142 26147 +5
=========================================
+ Hits 26142 26147 +5
Continue to review full report at Codecov.
|
END IF; | ||
|
||
IF OLD.broadcast_id IS NOT NULL AND OLD.delete_reason != 'A' THEN | ||
PERFORM temba_insert_broadcastmsgcount(OLD.broadcast_id, -1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we use BroadcastMsgCount
only (and incorrectly) for recipient_count when rendering broadcast created events in contact histories. Definitely doesn't feel necessary to decrement it when deleting messages and maybe it should be replaced with something that actually tracks recipients rather than msgs.
What if we didn't track all those counts we don't use