icgc-argo / platform-api

https://api.platform.icgc-argo.org/graphql
GNU Affero General Public License v3.0
0 stars 0 forks source link

Investigate - Error Counting Inconsistency on Submitted Data Page #609

Closed ghost closed 1 year ago

ghost commented 2 years ago

Reference - https://github.com/icgc-argo/platform-ui/issues/2385

The dictionary includes a validation check as follows: line_of_treatment_validation (1)

However, the 'Submitted Data' section shows rows as errors, but they are not actually errors:

line_of_treatment

Buwujiu commented 2 years ago

@sifavahora to make a new ticket from the investigation. Dan to provide more info on solution.

demariadaniel commented 1 year ago

When performing a Dictionary Migration, Donor documents are validated using Lectern. This populates the invalidDonorsErrors field which Submitted Data page relies on for displaying submission errors.

The errors that are returned do not consistently contain sufficient info for the Front End to accurately mark which records are invalid. This results in instances where we only know the DonorId and Error Field, but cannot distinguish between multiple records belonging to the same donor which all have the same error field.

The error objects that are returned from Lectern need an additional errorValue field populated on every entry. There is already error.info.value however only certain errors contain this field; ideally it should be populated for every error record.

This would allow front end to highlight cells where DonorId -> Field === errorValue

Example Error:


  {
    errorType 'INVALID_BY_SCRIPT',
    fieldName 'line_of_treatment',
    index 2,
    info {
      message "The 'line_of_treatment' field must be a value greater than 1",
    },
    message "The 'line_of_treatment' field must be a value greater than 1",
    entityName 'treatment'
  },



Proposed Change:


  {
    errorType 'INVALID_BY_SCRIPT',
    fieldName 'line_of_treatment',
    index 2,
    info {
      message "The 'line_of_treatment' field must be a value greater than 1",
      ** Additional field **
      errorValue: 0,
    },
    message "The 'line_of_treatment' field must be a value greater than 1",
    entityName 'treatment'
  },
Buwujiu commented 1 year ago

Investigation complete. Made an action ticket in lectern: https://github.com/overture-stack/js-lectern-client/issues/27. Closing this ticket.