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

Events are notified twice when listing for ANY and a specific value #1334

Closed
philipphenkel opened this issue Oct 2, 2018 · 9 comments
Closed
Assignees
Labels

Comments

@philipphenkel
Copy link
Contributor

Describe the bug
Events are notified twice when listing for ANY and a specific value for the same event source. This is caused by the implementation of registerWithDal.

To Reproduce
Steps to reproduce the behavior:
Run https://makecode.microbit.org/_MwM3KfKzCaU0
Press button A or B: it shows 2

Expected behavior
Event should be notified only once. Press button A or B: it shows 1

Screenshots
bildschirmfoto 2018-10-02 um 23 24 19

Desktop (please complete the following information):

  • affects all platforms
@philipphenkel
Copy link
Contributor Author

#1333 is a potential fix

@tballmsft
Copy link
Contributor

This is the defined behavior of the DAL with respect to ANY, as confirmed with Joe Finney,

@philipphenkel
Copy link
Contributor Author

I'm surprised that this is standard DAL behaviour as I "fixed" it pxt-microbit code.

To be precise a specific event triggers currently 4 notifications in pxt-microbit. I would expect that 1 event triggers 2 notifications only: the specific one and ANY.

@tballmsft Would it be helpful to analyze the behaviour of MicroPython?

@philipphenkel
Copy link
Contributor Author

My example was overly complicated. Please have a look here:

bildschirmfoto 2018-11-26 um 21 08 20

https://makecode.microbit.org/_CLjbK0asz6zx

@philipphenkel
Copy link
Contributor Author

@abchatra The behavior is still odd. As of today, the simulator shows 1 and the real device shows 4 when running my example: https://makecode.microbit.org/_CLjbK0asz6zx

@abchatra abchatra reopened this Jun 13, 2019
@jwunderl
Copy link
Member

For what it's worth, this same bug occurred in arcade microsoft/pxt-arcade#959, and was fixed in that case with microsoft/pxt-common-packages#829

@philipphenkel
Copy link
Contributor Author

@jwunderl @abchatra Woohoo! The long-standing issue was finally fixed. Thanks a lot.

I tested with latest MakeCode.microbit.org
makecode.microbit.org Version: 2.0.6
Microsoft MakeCode Version: 5.15.12

@martinwork
Copy link
Contributor

@philipphenkel But #2382

@philipphenkel
Copy link
Contributor Author

@martinwork I already had a look at #2382. It's a slightly different case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants