Skip to content

fix: blocks not receiving their own delete events#6655

Merged
BeksOmega merged 3 commits into
RaspberryPiFoundation:developfrom
BeksOmega:fix/receiving-delete-events
Nov 29, 2022
Merged

fix: blocks not receiving their own delete events#6655
BeksOmega merged 3 commits into
RaspberryPiFoundation:developfrom
BeksOmega:fix/receiving-delete-events

Conversation

@BeksOmega
Copy link
Copy Markdown
Contributor

The basics

  • I branched from develop
  • My pull request is against develop
  • My code follows the style guide
  • I ran npm run format and npm run lint

The details

Resolves

Fixes #6319

but actually this time.

Proposed Changes

Makes it so that block change listeners unregister themselves when they receive the delete event for the block they are associated with. This ensures they actually receive that event (i.e. they're not getting removed too early).

Behavior Before Change

Blocks were not receiving their own delete events.

Behavior After Change

Blocks are receiving their own delete events.

Reason for Changes

Sometimes you want to trigger cleanup / other operations when a block is deleted.

Test Coverage

Fixed test to actually wait for the delay built-in to the events system. Before the tests were passing incorrectly because we'd stubbed the fire method to fire immediately.

Documentation

N/A

Additional Information

N/A

@BeksOmega BeksOmega requested a review from a team as a code owner November 23, 2022 17:45
@BeksOmega BeksOmega requested a review from maribethb November 23, 2022 17:45
@github-actions github-actions Bot added the PR: fix Fixes a bug label Nov 23, 2022
Comment thread tests/mocha/event_block_delete_test.js Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: fix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom handling when the block is disposed

2 participants