dream-num / univer

Univer is an open-source alternative to Google Sheets, Slides, and Docs
https://univer.ai
Apache License 2.0
6.39k stars 545 forks source link

[Bug] Maximum call stack size exceeded error on formatting apply #2762

Closed maryasov closed 2 weeks ago

maryasov commented 1 month ago

Before you submit this issue, have you checked the following

Affected packages and versions

0.2.3

Reproduction link

loading 6 columns / 23000 rows of data to the new sheet. If I try to select all cells on the sheet and apply any formatting from the toolbar to them, the formatting is fully applied, but I get a "Maximum call stack size exceeded" error in the console. 2024-07-13_09-58

Expected behavior

I expect the formatting to be applied without errors. If nested cell traversal loops have such limitations, then processing should probably be performed by a queue of fixed portions of cells, regardless of the total amount of selected data.

Actual behavior

I have tested on several versions of the package from 0.1.17 to the current version 0.2.3. The result is the same. If the number of selected cells exceeds about ~124000, I get this error

System information

System: OS: Linux 6.9 Manjaro Linux CPU: (16) x64 AMD Ryzen 7 5800H with Radeon Graphics Memory: 7.95 GB / 30.69 GB Container: Yes Shell: 5.2.26 - /bin/bash Binaries: Node: 20.14.0 - ~/.nvm/versions/node/v20.14.0/bin/node npm: 10.7.0 - ~/.nvm/versions/node/v20.14.0/bin/npm pnpm: 9.4.0 - ~/.nvm/versions/node/v20.14.0/bin/pnpm

maryasov commented 1 month ago

https://univer.ai/examples/sheets-big-data the official big data example page gives the same errors

jikkai commented 1 month ago

https://univer.ai/examples/sheets-big-data the official big data example page gives the same errors

I didn't see the error you mentioned on this page. Could you provide a reproducible demo?

maryasov commented 1 month ago

https://univer.ai/examples/sheets-big-data the official big data example page gives the same errors

I didn't see the error you mentioned on this page. Could you provide a reproducible demo?

sequence of steps for reproduction:

  1. open https://univer.ai/examples/sheets-big-data in browser
  2. Press Ctrl+A to select all cells on active sheet
  3. Press Ctrl+B to set Bold style or any other formatting action from toolbar
  4. Formatting will apply to all selection, but in console appears 4 errors messages "Maximum call stack size exceeded"

Tested in: Linux, Chrome (stable) - same 4 errors Linux, Chrome (unstable) - same 4 errors Linux, Chromium - same 4 errors Linux, Firefox (in firefox there are different 3 error messages "RangeError: too many function arguments NextJS 31" Windows 11 23h2, Chrome (stable) - same 4 errors Windows 11 23h2, Edge (stable) - same 4 errors Windows 11 23h2, Firefox (3 error messages "RangeError: too many function arguments NextJS 31"

Dushusir commented 1 month ago

image SheetRenderController error @lumixraku

lumixraku commented 1 month ago

@maryasov Did formatting operation finished after the error ?

lumixraku commented 1 month ago

I got same error, but chrome did not hang up, it finished my operation in the end.

image
maryasov commented 1 month ago

@maryasov Did formatting operation finished after the error ?

yes. visually all formatting is applied