instedd / cdx

Connected Diagnostics Platform
https://cdx.io
9 stars 7 forks source link

Accessing the report crashes when the samples values are changed #1966

Closed diegoliberman closed 1 year ago

diegoliberman commented 1 year ago

Steps to reproduce the error

  1. Create a box, transfer it to another institution, confirm the transfer, upload the results, create a report.
  2. You'll see that you can access the report normally.
  3. Open any sample from the box. Edit any value, for example the Technician name.
  4. Go back to the report and try to open it.
  5. It will crash.

image

ysbaddaden commented 1 year ago

I can't reproduce. It may have been fixed by #1974 and/or #1975

leandroradusky commented 1 year ago

This error happens because the measured signal is converted to a string when the sample is edited.

In the last merge with the bugfixes made by @ysbaddaden this:

      - if @sample_form.measured_signal
        = f.form_field :measured_signal do
          = f.text_field :measured_signal, readonly: true

changed to

      - if @sample_form.measured_signal
        = f.form_field :measured_signal do
          .value= @sample_form.measured_signal

This will correct the error automatically?

ysbaddaden commented 1 year ago

Yes, it won't be sent anymore, so it won't be saved anymore.

ysbaddaden commented 1 year ago

QA: we didn't fix the existing invalid samples in staging. You must reproduce the edit steps with new samples.

sardar-usman commented 1 year ago

@leandroradusky It is working fine.