diff --git a/collector/collector.go b/collector/collector.go index d82af488294110e9861faf2007b3b9ede035d368..21e5235954cabb06bbdd368ce0a072ca120b7198 100644 --- a/collector/collector.go +++ b/collector/collector.go @@ -124,13 +124,14 @@ type updateResponse struct { } // SubmitMeasurement submits a measurement belonging to the report -// to the OONI collector. On success, we will modify the measurement -// updating its ReportID field. If the collector supports sending back to -// us a measurement ID, we also update the m.OOID field with it. +// to the OONI collector. We will unconditionally modify the measurement +// with the ReportID it should contain. If the collector supports sending +// back to us a measurement ID, we also update the m.OOID field with it. func (r *Report) SubmitMeasurement( ctx context.Context, m *model.Measurement, ) error { var updateResponse updateResponse + m.ReportID = r.ID err := (&jsonapi.Client{ BaseURL: r.client.BaseURL, HTTPClient: r.client.HTTPClient, @@ -143,7 +144,6 @@ func (r *Report) SubmitMeasurement( }, &updateResponse, ) if err == nil { - m.ReportID = r.ID m.OOID = updateResponse.ID } return err diff --git a/experiment/mkevent/mkevent.go b/experiment/mkevent/mkevent.go index 1709edc1f3fb4fc3fb67822722f110aa8cd29fd1..4151522bc0d983d40d863f424de6d90c4f9bbc4c 100644 --- a/experiment/mkevent/mkevent.go +++ b/experiment/mkevent/mkevent.go @@ -20,7 +20,7 @@ func Handle( ) { if event.Key == "measurement" { // We reparse the measurement and overwrite it. This is how we manage to - // return the measurement to the caller. Seriousy. + // return the measurement to the caller. Seriously. // // We panic if we cannot parse because since MK v0.9.0 the vendored // nlohmann/json library should throw if passed non UTF-8 input.