unfoldingWord / gateway-edit

Book Package harmonized view.
https://gatewayedit.com
MIT License
1 stars 4 forks source link

Bug in delete row when row is at the end of the book #592

Closed elsylambert closed 10 months ago

elsylambert commented 10 months ago

https://github.com/unfoldingWord/gateway-edit/assets/14238574/f34ccc91-df8f-442c-a0f1-e889ffd0af2f It is related to adding the tN to the end of the book. It's throwing an exception.

Screenshot 2023-11-22 at 7 30 43 AM
kintsoogi commented 10 months ago

This is happening when a tsv item is added at the very end of a book and it is the last tsv items in tsv items.

For some reason, when we get the tsvs back from DCS after adding, we receive and undefined Note value in the very last element.

Note is the last element in the TN tsv files, so I'm guessing something is happening when we are parsing the TSV file that we are receiving from DCS. I bet that we are looking at it and seeing that there's nothing at the end of the file for note, so we are passing an undefined value

This is not happening in useTsvItems, because the content array that we receive from useRsrc() has the item with the undefined note already. It must be happening in scripture resources rcl.

kintsoogi commented 10 months ago

Aha! This was happening in tsvToJson in scripture-resources-rcl. When the last item in a tsv was empty, the split() funciton would not add a value to the array of TSV row values, and so that property was being set to undefined. In our case, this property was the note property.

kintsoogi commented 10 months ago

@elsylambert @danielklapp

Test Instructions

danielklapp commented 10 months ago

After following test instructions, edits made are reflected in all the fields. Not seeing any major errors but an occasional 409 error in the console. When looking at the delete dialog it shows all the note information. Tested with v2.2.0 build 7018555 QA.

Screenshot 2023-11-29 at 11 01 52 PM
elsylambert commented 10 months ago

v2.2.0 build 7018555 QA. Not seeing error when a new row is added at the end of the book.