Import invalid XML file (applies to all delimited import parsers)
See original GitHub issueDescription
Created a text file containing the following:
This is bad data
This is bad data
This is bad data
This is bad data
Try to import it using the XML importer - exceptions occur, then the importer reports successful import with a heap of exceptions.
Steps to Reproduce
- Create a file containing the above lines and save as baddata.xml
- Select File->Import->From Delimited File…
- Set Import file Parser to XML, then press the “+” button and locate the file, and press Open.
- Acknowledge warning dialog twice (this is an issue - see below)
- On the main import dialog press the Import button. (this is enabled despite no data being valid in file) Expected behaviour: [What you expect to happen]
Actual behaviour: At step 3, the following dialog is shown (twice) After acknowledging twice, user is returned to main Import dialog, with the Import button enabled …
At step 5, despite data being invalid - so nothing to import, a dialog is raised suggesting “X” lines of data were imported along with multiple Exception dialogs. See below:
Reproduces how often: 100%
Additional Information
One of the issues here is the code generating the “Success dialog” is independant of the actual import and just counting lines of text in the file.
So there are really 4 problems:
- Invalid XML files don’t get neatly handled up front … a single warning should be displayed.
- The import button is enabled (I can live with that if it doesn’t die ugly) - but when clicked tries to import invalid data.
- Press the import button and excpetions are thrown (ugly)
- The number of “rows” imported is in no way correlated to rows of records … in fact, this occurs even if the import XML is successful as the counter is assuming one record per line is is the case for CSV files. Surely we can get the number of records from the importer record list instead ?
This problem really needs to be checked for all importers in case there is similar.
Note: I fond the warning dialogs seem to pop up behind the import dialog generally so are hard to see… which means context is taken away from the user and the tool becomes un-useable until usr clicks back on the main window … at which point the warning dialogs appear.
Note 2: The “Success” dialog is displayed before the data is imported… surely you can only show success after the import is completed.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top GitHub Comments
Hi @arcturus2 Moving this to “In progress” as we are still working on this case.
I believe some refactoring related to the import dialog needs to be done to do 2 things:
displayAlert("Success", "Successfully imported " + noOfRows + " rows from the following file(s):\n" + String.join("\n", filenames), true);