report notice counts cumulatively from a database baseline

Moving watermarks after each accepted send kept the install ID and the notice baseline out of step: pre-consent notices went out, notices raised before the first send were dropped, and a send that finished after an off/on toggle overwrote the new identity's baseline. health.notices now carries cumulative counts since the install ID was created. Creating an ID copies the lifetime counts into the existing reported_* columns before the state file names it, and nothing is written after a send, so the backend diffs consecutive reports per install ID.
This commit is contained in:
Josh Hawkins
2026-11-01 12:30:35 -06:00
parent 894d8a400c
commit b4ff802ddf
11 changed files with 191 additions and 104 deletions
+4 -4
View File
@@ -906,7 +906,7 @@
"additionalProperties": {
"$ref": "#/$defs/NoticeCounts"
},
"description": "Notice counts by kind since the last accepted report",
"description": "Cumulative notice counts by kind since the install ID was created",
"propertyNames": {
"$ref": "#/$defs/NoticeKindKey"
},
@@ -1103,21 +1103,21 @@
"additionalProperties": false,
"properties": {
"acknowledgements": {
"description": "Acknowledgements since the last accepted report",
"description": "Acknowledgements since the install ID was created",
"minimum": 0,
"title": "Acknowledgements",
"type": "integer",
"x-public": true
},
"mutes": {
"description": "Mutes since the last accepted report",
"description": "Mutes since the install ID was created",
"minimum": 0,
"title": "Mutes",
"type": "integer",
"x-public": true
},
"occurrences": {
"description": "Occurrences since the last accepted report",
"description": "Occurrences since the install ID was created",
"minimum": 0,
"title": "Occurrences",
"type": "integer",