sugarlabs / musicblocks

Music Blocks -- A musical microworld
https://musicblocks.sugarlabs.org/
GNU Affero General Public License v3.0
558 stars 758 forks source link

fix(flowblock.js): infinite loop warning #3824

Closed aryanndwi123 closed 6 months ago

aryanndwi123 commented 6 months ago

fixes #3820 console.warn(mssg) when there is a chance of infinite loop in the forever flow block

aryanndwi123 commented 6 months ago

@walterbender @pikurasa Please review my PR and tell me if there is any changes or additional logic for the code.

pikurasa commented 6 months ago

It doesn't seem to pass the smoke test for me...

MB-testing-1710522341787.log Screenshot from 2024-03-15 13-05-19

commit 38e4c5c079337171e6896a15fd371a96fc57e3c2

@aryanndwi123 please test it.

walterbender commented 6 months ago

I think I understand what you are trying to do here, but I am not sure that it would work. Have you tested it? In any case, the intention is to use the errorMsg function to display a warning message to the user, not to the console, which is more of a developer tool.

aryanndwi123 commented 6 months ago

Yes @walterbender and @pikurasa the code is updated and tested now , utilizing the errorMsg function to display warning messages to users as intended.

Now instead of extending the NoteBlock class to indirectly display warnings via console.warn() I've displayed warning message within the RepeatBlock class,

walterbender commented 6 months ago

I still don't understand how your change works. Where is the isInForever set?