From 295a07475f3477cb6fe5209cd75fdb3ac4dad3ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Sch=C3=BCtz?= Date: Tue, 28 Jul 2020 16:55:31 +0200 Subject: [PATCH] Add start time to alerts unique (#139) * Add contact_start to alert id * Encode report signature as hex --- src/reports_update/reports_updater.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/reports_update/reports_updater.rs b/src/reports_update/reports_updater.rs index ed77109..ef0dde2 100644 --- a/src/reports_update/reports_updater.rs +++ b/src/reports_update/reports_updater.rs @@ -126,9 +126,14 @@ where }); let measurements = exposure.measurements(); + let report_sig_bytes: [u8; 64] = signed_report.sig.into(); Ok(Alert { - id: format!("{:?}", signed_report.sig), // TODO this is wrong now: one report can have multiple alerts + id: format!( + "{}-{}", + hex::encode(report_sig_bytes.to_vec()), + measurements.contact_start.value + ), report_id: format!("{:?}", signed_report.sig), symptoms: public_symptoms, contact_start: measurements.contact_start.value,