Skip to content

Commit

Permalink
Add start time to alerts unique (#139)
Browse files Browse the repository at this point in the history
* Add contact_start to alert id

* Encode report signature as hex
  • Loading branch information
ivnsch authored Jul 28, 2020
1 parent 1662de4 commit 295a074
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/reports_update/reports_updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 295a074

Please sign in to comment.