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 lazy state #643

Merged
merged 2 commits into from
Apr 3, 2024
Merged

Fix lazy state #643

merged 2 commits into from
Apr 3, 2024

Conversation

josephjclark
Copy link
Collaborator

The lazy state operator $ is causing trouble if you try to use $ as a variable, a la:

parseXML(state.data, $ => {
    const inner = $.load(response.text()); // error
 });

This PR adds a bit of intelligence to the is-this-a-lazy-state-reference heuristic to ignore $ variable declared in the source. See the unit tests for details.

@josephjclark
Copy link
Collaborator Author

@mtuchi assuming this passes CI tests and it works for you, you can merge it and it'll be released! You'll have to ask Taylor to bump the lightning worker

@mtuchi
Copy link
Contributor

mtuchi commented Mar 28, 2024

@josephjclark let's hold this, i would love to test before merging.

@mtuchi
Copy link
Contributor

mtuchi commented Apr 3, 2024

Hiya @josephjclark i have tested this, it works as expected. Thanks for the fix 👍🏽

Copy link
Contributor

@mtuchi mtuchi left a comment

Choose a reason for hiding this comment

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

Tested locally on water-aid project, it works as expected 👍🏽

@josephjclark josephjclark merged commit 5eef3a0 into main Apr 3, 2024
6 checks passed
@josephjclark josephjclark deleted the fix-lazy-state branch April 3, 2024 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants