bihealth / sodar-server

SODAR: System for Omics Data Access and Retrieval
https://github.com/bihealth/sodar-server
MIT License
14 stars 3 forks source link

Source cell editing not working in assay table after row insert #1928

Closed mikkonie closed 3 months ago

mikkonie commented 3 months ago

While looking into #1904 I keep finding more bugs in the sheet editor. Yay.

Describe the Bug

Renaming a source does not work correctly after inserting a new row in the assay table. It appears to work, but only affects the last row of study and assay tables and the value is not in fact changed. Exiting edit mode displays the original source name again. Re-entering editing mode and editing the source name displays the correct value again and it can be edited as expected.

How to Reproduce

  1. Add new row into the assay table with an already used sample (Note: It doesn't matter if you first add a new source/sample or not, but this lets you observe the results better)
  2. Commit the row insert but stay in edit mode
  3. Edit the source name (Edit: OR any other value in the source node of the new row)
  4. Notice there is no Saved message after the edit
  5. Notice only the last rows in the study and assay tables get changed in the UI
  6. Exit edit mode
  7. Notice the original value is present in all cells for the source name column

Expected Behavior

Since we don't (yet) support changing the node reference, we should rename the node and it should be propagated to all cells of the same source name, exactly like it does when a non-new row is edited.

Screenshots

2024-03_source_rename_bug

mikkonie commented 3 months ago

On first glance, it would seem value.newRow is not correctly set to false for the source columns, or at least not the source name. I'll look into it in more detail tomorrow.

Update: This seems to be caused by handleRowInser() failing if assayMode=true. It only affects the assay table as far as I can see at the time of writing. Debugging notes below.

Notes

mikkonie commented 3 months ago

Fixed. A simple thing in the end, but was somewhat painful to reproduce and debug.