CSV Header Trailing and Leading Spaces Cause Missing Data

Answered
Ben Greaves asked on October 31, 2023

Hi, we think we have discovered a bug introduced sometime between version 2.8.21 and version 2.9.52.

Our React 18.2.0 project imports Flexmonster and react-flexmonster. Both were recently upgraded to 2.9.52. We began receiving complaints that some columns have missing data.

The data source that we feed into Flexmonster is CSV. In the header row of the CSV, if a header column has either a trailing space or a leading space in the name, the bug will appear. Specifically, the header column must look like any of these cases for the bug to appear:
" Header Column"
"Header Column "
" Header Column "

Flexmonster will register the column as a valid column, and the column will appear in the Field Selector as a selectable column, etc. However, all of the data will be blank.

We have considered adding some code that removed trailing and leading space before passing the CSV to flexmonster. However, that would "break" our existing reports that contains definitions that refer to columns with leading/trailing spaces.

Please advise. During our testing, this bug does not appear when we revert to 2.8.21. It does appear in versions 2.9.52 and 2.9.60.

For the time being, we will revert to 2.8.21.

Would it be possible to get a bug fix on the roadmap?

Thank you,
-Ben

1 answer

Public
Maksym Diachenko Maksym Diachenko Flexmonster November 1, 2023

Hello, Ben!

Thank you for reporting this issue.

We were unable to reproduce this issue on our side. Could you please provide us with the additional details, such as:

  • A CSV file on which the issue is reproduced. If necessary, the real data can be replaced with a dummy dataset.
  • The component's report settings, so that the reason for the bug could possibly be traced to some of the non-default settings.

This information will greatly help us in our further research.

Looking forward to hearing from you.

Best Regards,
Maksym

Please login or Register to Submit Answer