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]: Match node matches wrong #337

Open
1 task done
andris1 opened this issue Jan 24, 2024 · 3 comments
Open
1 task done

[Bug]: Match node matches wrong #337

andris1 opened this issue Jan 24, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@andris1
Copy link

andris1 commented Jan 24, 2024

What happened?

I have an array of objects that looks like this:

{
  "fn_name": "{{fn_name}}",
  "values": {
    "fn_arguments": "{{fn_arguments}}", 
    "response_message": "{{response_message}}"
  }
}

fn_name can sometimes be null (which is what I suspect is causing issues)

I destructure it to get fn_name and values (so far so good) to pass to the match node as test and value inputs respectively.

Say fn_name is something like ['fn1', 'fn2', null, null] and the match node has fn1 and fn2 to match against. Match will match all 4 of them against fn1.

What was the expected functionality?

Expected fn1 to match against fn1, and null to match against unmatched.

Describe your environment

Windows, Rivet 1.7.7.

Relevant log output

No response

Relevant screenshots

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@andris1 andris1 added the bug Something isn't working label Jan 24, 2024
@andris1
Copy link
Author

andris1 commented Jan 24, 2024

Upon exploring it more, I'm even more confused.

image

In the above example, the result I expected was match to produce: val1, val2, unmatched/red herring.

@andris1
Copy link
Author

andris1 commented Jan 24, 2024

Ok, I understood that you can put the whole thing into a subgraph to run it n times and then coalesce.

So not a bug, issue can be closed. Not the behavior I expected though.

@andris1 andris1 closed this as completed Jan 24, 2024
@abrenneke
Copy link
Collaborator

Yeah @andris1 match nodes (or any node that conditionally doesn't run some of its outputs) don't really work with Split mode turned on unfortunately. The status of which array indicies run for each port is lost right now. I'm going to reopen this since it's definitely something we should track.

@abrenneke abrenneke reopened this Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants