ashishd751 / react-excel-renderer

A react library to render and display excel sheets on webpage
MIT License
173 stars 53 forks source link

Infinite loop when xlsx file has 2 lines with 1 empty value #6

Closed francoisruty closed 4 years ago

francoisruty commented 4 years ago

Hello, first of thanks for your lib, it's awesome. I've installed the npm package version 1.1.0.

I've been able to visualize excel files in my simple app so it's great.

However, I have one particular xlsx file that, when uploaded, crashes the browser tab in which the web app is running. I've checked, it's the ExcelRenderer that is stuck in an infinite loop, and it's before the callback so not in my code. This excel file has bogus data, has only 2 lines, and the particularity is that it has one missing value on the second line. I don't know why this exact configuration triggers the crash, but here is the excel file:

pg_model_err.xlsx

francoisruty commented 4 years ago

I just noticed that the empty value is irrelevant, I also have the problem with any xlsx file with 2 full lines. I don't know what conditions trigger this bug, except that the file I uploaded does. I'm interested in your opinion!

ashishd751 commented 4 years ago

Hey,

Thank you for informing me about the bug.

I'll try to replicate it, and let you know. In the meantime, if you're in a hurry, feel free to fork and inspect it yourselves.

Have a great day and a happy new year. Cheers.

Regards, Ashish Deshpande

On Mon 30 Dec, 2019, 9:35 PM francoisruty, notifications@github.com wrote:

Hello, first of thanks for your lib, it's awesome. I've installed the npm package version 1.1.0.

I've been able to visualize excel files in my simple app so it's great.

However, I have one particular xlsx file that, when uploaded, crashes the browser tab in which the web app is running. I've checked, it's the ExcelRenderer that is stuck in an infinite loop, and it's before the callback so not in my code. This excel file has bogus data, has only 2 lines, and the particularity is that it has one missing value on the second line. I don't know why this exact configuration triggers the crash, but here is the excel file:

pg_model_err.xlsx https://github.com/ashishd751/react-excel-renderer/files/4010264/pg_model_err.xlsx

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ashishd751/react-excel-renderer/issues/6?email_source=notifications&email_token=ACAIS6OYBHBPFOCB62Q4E5DQ3IL5PA5CNFSM4KBN5HM2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IDLW2JQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAIS6LAHW5GRB2J4ZERYCDQ3IL5PANCNFSM4KBN5HMQ .

francoisruty commented 4 years ago

I'm working on a prototype so no hurry on my side, if it's validated to go to production (should be decided in 1 month) I'll need to fix it indeed if you hadn't had time on your side yet thanks and happy new year!

francoisruty commented 4 years ago

Side note: the infinite loop seems to come from the fact that the lib just reads all empty lines at the bottom of the xlsx file. So the lib actually works, you end up with the results, but the callback sends you like 2M rows and this is what crashes the browser