Skip to content

Conversation

@BeksOmega
Copy link
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
@BeksOmega BeksOmega merged commit 485bd4d into RaspberryPiFoundation:develop Nov 29, 2022
BeksOmega added a commit that referenced this pull request Dec 1, 2022
BeksOmega added a commit that referenced this pull request Dec 1, 2022
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