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

startHats filter by a menu that acceptReporters #4128

Open
zjn0505 opened this issue Nov 20, 2023 · 1 comment
Open

startHats filter by a menu that acceptReporters #4128

zjn0505 opened this issue Nov 20, 2023 · 1 comment

Comments

@zjn0505
Copy link

zjn0505 commented Nov 20, 2023

Expected Behavior

To trigger this Event block

{
   opcode: 'whenArrived',
   blockType: BlockType.EVENT,
   text: 'When robot arrive [LOCATION]',
   func: 'whenArrived',
   arguments: {
      LOCATION: {
         type: ArgumentType.STRING,
         defaultValue: "location",
         menu: 'LOCATION',
      }
   },
   isEdgeActivated: false,
}

I am calling this runtime.startHats("robot_whenArrived", { LOCATION: location }, target);

I expect that the menu can acceptReporters and startHats will still works with reporter block as arguments.

Actual Behavior

Only blocks with items selected from menu can be triggered by startHats.

image

It cannot take reporters as arguments.

image

Steps to Reproduce

Using reporter as argument will make hatFields[matchField] undefined in this check

// Match any requested fields.
// For example: ensures that broadcasts match.
// This needs to happen before the block is evaluated
// (i.e., before the predicate can be run) because "broadcast and wait"
// needs to have a precise collection of started threads.
for (const matchField in optMatchFields) {
if (hatFields[matchField].value !== optMatchFields[matchField]) {
// Field mismatch.
return;
}
}

@mxmou
Copy link

mxmou commented Nov 20, 2023

This is probably a duplicate of #1922.

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

No branches or pull requests

2 participants