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

fix(VariableResolver): correctly filter out already existing properties #30

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

marstamm
Copy link
Collaborator

@marstamm marstamm commented Mar 7, 2024

@marstamm marstamm requested a review from a team March 7, 2024 13:19
@marstamm marstamm self-assigned this Mar 7, 2024
@marstamm marstamm requested review from philippfromme and barmac and removed request for a team March 7, 2024 13:19
@bpmn-io-tasks bpmn-io-tasks bot added the needs review Review pending label Mar 7, 2024

target[property].push(...originToAdd);
target[property].push(...propertiesToAdd);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If spread can cause problems, why do we keep using it?

Suggested change
target[property].push(...propertiesToAdd);
target[property] = target[property].concat(propertiesToAdd);

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a (desired) side effect of using .push, we modify the original array, which is referenced from nested variables as well. So you will get the correct list of origins for a (sub-)variable even when it was added through mappings.

The Stack index was only a symptom of another problem, so it should be safe to use it

Copy link
Member

@nikku nikku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff!

@nikku nikku merged commit 6e3b711 into main Mar 11, 2024
6 checks passed
@nikku nikku deleted the fix-callstack-exceeded branch March 11, 2024 10:23
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Mar 11, 2024
@nikku
Copy link
Member

nikku commented Mar 11, 2024

Let's get this released and integrated + give web modeler a heads up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants