8000 Merge node fix by makaveli2P · Pull Request #56 · urban-toolkit/curio · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Merge node fix #56

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

Merged
merged 3 commits into from
Jul 10, 2025
Merged

Conversation

makaveli2P
Copy link
Contributor
@makaveli2P makaveli2P commented Jul 9, 2025

Describe your changes

This PR fixes inconsistent merge node behavior by introducing position-based input handling. Previously, merge nodes used a loop-based approach that led to unpredictable input ordering. Now:

  • in (top-left) is always the primary input.
  • in_2 (bottom-left) is always the secondary input.

Key Improvements

  • Replaced loop-based logic with explicit positional merging.
  • Prevented invalid states by disallowing more than two inputs.
  • Improved TypeScript typings and input handling in FlowProvider.

Note: This fix applies to new connections only. Existing workflows with incorrect merge node setups may need manual updates.

Thanks to @tuanduc8t1 for identifying this, it's an important UX issue.

Issue resolved by this PR (if any)

Type of change (Check all that apply)

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Other:

Parts of Curio impacted by this PR:

  • Frontend
  • Backend
  • Sandbox

Testing

  • Unit Tests
  • Manual Testing (please provide details below)

Screenshots (if relevant)

Screenshot 2025-07-09 at 16 44 42 Screenshot 2025-07-09 at 16 44 54

Checklist (Check all that apply)

  • I have manually loaded each .json test from the tests/ folder into Curio, ran all the nodes one by one, and checked that they run without errors and give the expected results
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@fabio-miranda
Copy link
Contributor

I think this is great, thank you! Could you change the target handle "in" to be "in_1" so that it matches the format of the second target handle "in_2"?

@makaveli2P
Copy link
Contributor Author

I think this is great, thank you! Could you change the target handle "in" to be "in_1" so that it matches the format of the second target handle "in_2"?

Took me a bit longer than expected becase I kept testing with the old Merge.json file that still had "in" references, so even after fixing the handle logic in useCode.ts hook (which i also missed in the beginning), the save/load wasn't working.
So, I updated the test file as well in the latest commit.
Now everything works consistently: in_1 for primary input, in_2 for secondary, and the save/load cycle handles both properly.

@fabio-miranda fabio-miranda merged commit 19be15b into urban-toolkit:main Jul 10, 2025
1 check passed
@makaveli2P makaveli2P deleted the merge-node-fix branch July 10, 2025 15:15
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.

2 participants
0