Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: xlsx-renderer/Renderer mutate viewModel argument. #137

Closed
Siemienik opened this issue Jan 16, 2021 · 0 comments · Fixed by #138 or #236
Closed

BUG: xlsx-renderer/Renderer mutate viewModel argument. #137

Siemienik opened this issue Jan 16, 2021 · 0 comments · Fixed by #138 or #236
Assignees
Labels
accepted It is accepted to do BUG Something isn't working important Do it first

Comments

@Siemienik
Copy link
Owner

The renderer mutates a viewModel by adding information about the current loop states or deleting variables by using `DeleteCell. It is wrong behaviour and it shouldn't do that, because it causes next bugs, for instance, if the same VM is used twice.

Here was proposed a workaround, that makes deep copy before each render() call.

This issue will be fulfilled when calls render() function will stop mutate the ViewModel.

The quickest solution is making deep copy inside the render() function. However, it isn't a fully satisfying solution, because it will take additional time and memory. I consider making a proxy object, which read all object data from source (VM) and - if required - mutates data in a proxy.

As this bug, I estimate critical important I want to make a deep copy by using JSON.parse(JSON.stringify()) ASAP. Then I will analyze a better solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted It is accepted to do BUG Something isn't working important Do it first
Projects
None yet
1 participant