Mute unmute history

Hi there,
About the mute and unmute transition, I extracted data from mute and unmute data_records, and ordered them in chronological order. And I found :

  1. For the same place we have successive mutes without unmutes between the mutes (the same thing happens with successive unmutes without mutes between them)

  2. Successive mutes/unmutes have the same day in the report_date, and there are intervals of a few minutes between them

We are interested in calculating the state (mute/unmute) of a given place from this “history of events” on a given date, since we do not need to know the exact datetime, I do notconsider the sequence of successive mute except the first one, I do so the successive mute did not occur, since everything happens on the same day, I do not introduce any major error in the date only in the time.

I would like to understand how these successive mute occur in the same place:
maybe the user submits a mute form but it doesn’t change the state of the place and within minutes the user resends the mute form. I haven’t seen this behavior in the cht, when I send a mute form the place get muted
So i would like to have some help to understand how these successive mute occur.

form_uuid clinic_uuid reported op count
08c06301-72c0-46ba-97ae-764d1cd1a026 2019-11-02 16:04:46.000000 add 1
5b806f54-7d0a-4775-b49b-083a1451aca8 08c06301-72c0-46ba-97ae-764d1cd1a026 2020-09-14 22:47:00.000000 mute -1
f1bc7a38-ec68-403d-94d5-3ac0bfb72a1c 08c06301-72c0-46ba-97ae-764d1cd1a026 2020-10-13 22:47:03.000000 unmute 1
f9cb7de8-23e1-4727-a406-ce836e9392f4 08c06301-72c0-46ba-97ae-764d1cd1a026 2020-10-13 22:48:28.000000 unmute 1
58f0dc1a-21a8-47ff-9350-b81123bfdc4d 08c06301-72c0-46ba-97ae-764d1cd1a026 2020-10-13 22:53:02.000000 unmute 1
8664150b-99d6-4d65-8c7c-c4f75b76e8e7 08c06301-72c0-46ba-97ae-764d1cd1a026 2020-10-13 22:55:29.000000 unmute 1
3c6e5efa-5b5e-497a-b0ab-3d37cd4d19f8 08c06301-72c0-46ba-97ae-764d1cd1a026 2022-04-25 10:01:29.000000 mute -1
5cd5f964-6d5f-4679-b37a-0ae561fa8403 08c06301-72c0-46ba-97ae-764d1cd1a026 2022-06-08 22:07:53.000000 unmute 1

Hey @bamatic

Prior to 3.12, Muting was performed on the server… so if an offline user submitted a mute or unmute report on their device, they wouldn’t actually see the affects until they synced that report up to the server, the server processed it, and they synced back down. Starting in 3.12, Muting and Unmuting are performed on-device for offline users.

In the sample you provided, all those Unmutes that happened within minutes of each other were from 2020. 3.12 was released on 28-July-2021 so hopefully you don’t see that issue happening after the date you updated to 3.12+.

The SQL below will tell you the version and time that each server upgrade started on your instance

	doc#>>'{tombstone,build_info,version}' AS app_version,
	to_timestamp(((doc#>>'{tombstone,created}')::bigint / 1000)::double precision)::date AS upgrade_started
	doc#>>'{tombstone,_id}' = 'horti-upgrade'
	AND doc->>'type' = 'tombstone'

1 Like

Hi michael
Thank you very much for this information

3.15.0 2022-08-09
3.14.2 2022-07-29
3.13.0 2022-01-25
3.10.3 2021-03-24
3.4.1 2019-06-17
3.2.1 2019-06-17

So from 2022-01-25 I should not see this kind of muting repetition, and this is true.

Now I’ve found 29 places from a total of about 3000 places having some anormal muting history, for example this place has this history obteined from data_records

form form_uuid clinic_uuid reported op
252506b5-c91f-4dd1-abcc-a7183558be6d 2019-10-31 14:55:30 add
mute_chw_area ca8557cc-70a9-49d5-a4be-0d043bffa7d7 252506b5-c91f-4dd1-abcc-a7183558be6d 2022-05-31 12:24:51 mute
unmute_chw_area 1b20ff9b-9bb6-42d7-ba74-ba212b296797 252506b5-c91f-4dd1-abcc-a7183558be6d 2022-06-11 15:03:55 unmute
unmute_chw_area af8642b7-b8aa-4f83-98f4-2c4730409d37 252506b5-c91f-4dd1-abcc-a7183558be6d 2022-06-22 12:49:45 unmute

And looking to the info doc with doc_id = ‘252506b5-c91f-4dd1-abcc-a7183558be6d’ I have that

"_id": "252506b5-c91f-4dd1-abcc-a7183558be6d-info",
 "_rev": "9-3753b555e7582fffb3fbde705546fe4d",
 "type": "info", 
"doc_id": "252506b5-c91f-4dd1-abcc-a7183558be6d", 
"transitions": {
"muting": {
"ok": true, 
"seq": "204659-g1AAAAJ7eJyd0VEKwjAMANCgA_31AKInkHVr1-7L3USbdmOMqV9-6030IILeww-9gUeYXTvczxA2Agkk5FGaEgCm-VjDTB2OKteYkICvfBOkNKORBFxUVVXkYwRQZGd6EymowIB17fyRcGkyrluMWYxlRNMU-2JJjW1-mJ5bTDCOnIZ9sW2NnVrsaTGMo9DXtCe290yGsynGuzgQPxaMOEHl-4PAqwPvzQszC2YkjALW9xAOfDjw1RzjZsE0DSUjchD4dmDzh6lnQc6FDGLRtVp8AUhKpMQ", "last_rev": "3-9542b4e5c848230bd405c38f9af21991"
 "muting_history": [
"date": "2022-05-31T15:10:46.285Z", 
"muted": true, 
"report_id": "ca8557cc-70a9-49d5-a4be-0d043bffa7d7"
"date": "2022-06-15T19:34:31.507Z", 
"muted": false, 
"report_id": "1b20ff9b-9bb6-42d7-ba74-ba212b296797"
"date": "2022-06-22T16:30:33.827Z", 
"muted": false, 
"report_id": "af8642b7-b8aa-4f83-98f4-2c4730409d37"
 "latest_replication_date": "2022-06-22T16:30:31.935Z", "initial_replication_date": "unknown"

Here we have that there are even some days difference between chw_are_unmute reported data_record date and info-doc “”
and two unmutes without a mute between them.