BUG: admins sending messages disables disappearing message timer
- BUG SYMPTOMS:
- sending messages to contact with whom we have set the message expiry timer to some non-zero value always overrides that value and turns the timer off
- EVIDENCE:
- inspecting the logs shows that just before the message timer is
reset to zero, an ordinary message has the
expiresInSeconds
field set to 0 (though the channel messageExpiratinTime is 30) - inspecting the signald keystore for the given channel shows that
all contacts other than the sending admin do not have any
messageExpirationTime
values set at all [2]
- inspecting the logs shows that just before the message timer is
reset to zero, an ordinary message has the
- LIKELY CAUSE:
-
Manager.sendMessage
callsmessageBuilder.withExpiration
and consults,contact.messageExpiryTime
, which is null (for all recipients accept the sending admin), and thus setsexpiresInSeconds
to 0
-
- FIX:
- To satisfactorily fix this we should investigate why calls to
Manager.setExpiration
are successfully updating timers with actual devices in the UX but not in the contact store. However, a cursory audit of that codepath looks like it should be working - (I already tried commenting out the call to
Manager.setExpiration
to see if simply not mentioning the expiry time would restore the previously observed working behavior)
- To satisfactorily fix this we should investigate why calls to
[1]
app_1 | [dispatcher | 2020-09-29T18:26:14.257Z]
app_1 | --------
app_1 | {"type":"message","data":{"username":"<redacted>","source":{"number":"redacted"},"sourceDevice":4,"type":"CIPHERTEXT","timestamp":1601403974066,"timestampISO":"2020-09-29T18:26:14.066Z","serverTimestamp":1601403974242,"serverDeliveredTimestamp":1601403974218,"hasLegacyMessage":false,"hasContent":true,"isUnidentifiedSender":false,"dataMessage":{"timestamp":1601403974066,"body":"! DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD","endSession":false,"expiresInSeconds":0,"profileKeyUpdate":false,"viewOnce":false}}}
[2]
"contactStore" : {
"contacts" : [ {
"address" : {
"number" : "<redacted>"
},
"profileKey" : "xlLx25XTZ6xcyVDDOzUJd2vhRN6+EhG0XMDJ8dpRiq4=",
"messageExpirationTime" : 1800
}, {
"address" : {
"number" : "<redacted}",
"uuid" : "9bccece2-ef07-4576-9bd8-aca847c7a753"
},
"profileKey" : "sx47lzpmLzsGbDVSjsaLixeScAF4MyyK3seFwSi2+zY="
}
// snip
]
}