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: Inconsistency between Flow Runs and "Test this Step" when using Optional Chaining (?.) on Return Objects #5364

Closed
zach-wire3 opened this issue Feb 24, 2025 · 1 comment
Assignees
Labels
bug Something isn't working release: 1.468.0

Comments

@zach-wire3
Copy link

Describe the bug

I use the optional chaining operator (?.) a lot in windmill to ensure steps run smoothly regardless of return values in prior steps. There is a functional inconsistency between the actual flow running and when using "test this step" when using it against the results object.

To reproduce

  1. Step up a flow that has two steps, with the first step producing an output object and the second step connected directly to a field of that output object.
  2. When connecting the second step, use standard dot notion against the results object.
  3. In the second step, use the "Test this Step" refresh button to see data load from the first step as a parameter, mimicking windmill flow functionality.
  4. Witness the data flow into the step as per normal by testing the second step.
  5. Use the "Test Flow" button and run the flow as per normal, witnessing the data flow as per normal between the first step to the second step.
  6. Return to the editor, and replace the dot notation to optional chaining in the second step, i.e. results?.a.foo
  7. Use the "Test this Step" refresh button again to see the data load as a parameter, repeating the same functionality as in bullet point 3.
  8. Witness the data flow into the step as per normal by testing the second step, same functionality in bullet point 4.
  9. Use the "Test Flow" button and run the flow again, but this time you see that the second step does NOT get the data passed in as a parameter, breaking the expectation that it was going to be loaded.

Expected behavior

All I expect is consistency between the flow editor and flow runs. I have had a few bugs popup and took me a bit to

Two potential solutions:

  • Don't allow optional chaining against the results object directly when linking data between flows. It should be noted that this only happens when you optional chain against results directly, implying that results isn't really an object but some proxy between step outputs. (Aka, trying to pass results as a parameter to a step as-a-whole does not work). Either a warning/red squiggle in the flow editor should popup as a consequence of trying to optional chain against results

  • Repair functionality for optional chaining against the results object in the backend to match the functionality of the flow editor

Screenshots

Screencast.from.02-24-2025.01.23.57.PM.webm

Browser information

Firefox 135 and Chrome 130

Application version

EE v1.466.3-14-g3188bee46

Additional Context

No response

@zach-wire3 zach-wire3 added the bug Something isn't working label Feb 24, 2025
@rubenfiszel
Copy link
Contributor

Fixed in very latest, not sure how this bug stayed unreported for so long, thanks for the report. It's option 2 that was chosen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working release: 1.468.0
Projects
None yet
Development

No branches or pull requests

2 participants