Skip to content

fix: replace pause() with delayExecution() in updateBounds (#6038)#6166

Merged
omsuneri merged 3 commits intosugarlabs:masterfrom
piyushdotcomm:fix/6038-replace-pause-with-delayExecution
Mar 9, 2026
Merged

fix: replace pause() with delayExecution() in updateBounds (#6038)#6166
omsuneri merged 3 commits intosugarlabs:masterfrom
piyushdotcomm:fix/6038-replace-pause-with-delayExecution

Conversation

@piyushdotcomm
Copy link
Contributor

@piyushdotcomm piyushdotcomm commented Mar 8, 2026

Summary

Fixes #6038

Root Cause

Block.updateCache() contains a retry loop called updateBounds
that called that.pause(delayTime) — but pause() was never
defined on the Block class. This caused an uncaught promise
rejection that broke block rendering during collapse/expand
operations.

Fix

Replaced that.pause(delayTime) with delayExecution(delayTime)
— the same global utility that _createCache() already uses
correctly for the identical pattern.

Testing

Ran the block-related test suite — 34/34 tests pass:
Test Suites: 1 passed, 1 total
Tests: 34 passed, 34 total

PR Category

  • Bug Fix
  • Feature
  • Performance
  • Tests
  • Documentation

@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2026

✅ All Jest tests passed! This PR is ready to merge.

@github-actions github-actions bot added the bug fix Fixes a bug or incorrect behavior label Mar 8, 2026
@piyushdotcomm piyushdotcomm force-pushed the fix/6038-replace-pause-with-delayExecution branch from 5bfd264 to 404876d Compare March 8, 2026 19:16
@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2026

✅ All Jest tests passed! This PR is ready to merge.

@Ashutoshx7
Copy link
Contributor

some changes are unrelated please remove

@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

✅ All Jest tests passed! This PR is ready to merge.

@piyushdotcomm
Copy link
Contributor Author

some changes are unrelated please remove

Thanks for pointing that out. I have removed the unrelated changes and updated the PR so that it only contains the fix for replacing pause() with delayExecution() in updateBounds.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

❌ Some Jest tests failed. Please check the logs and fix the issues before merging.

Failed Tests:

GraphicsBlocks.test.js

@Ashutoshx7
Copy link
Contributor

@piyushdotcomm lgtm
no need to fix graphics block.test,js its not related to your pr
so it good to go
i feel this is your first pr in sugarlabs /musicblocks
welcome

@omsuneri omsuneri merged commit 98745bf into sugarlabs:master Mar 9, 2026
8 checks passed
@piyushdotcomm
Copy link
Contributor Author

Thanks for reviewing and merging the PR! I appreciate the feedback and look forward to contributing more to musicblocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fix Fixes a bug or incorrect behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Undefined pause() call in Block.updateBounds

3 participants