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

fix!: have disposing be true from start of dispose #7891

Merged
merged 1 commit into from Mar 13, 2024

Conversation

BeksOmega
Copy link
Collaborator

@BeksOmega BeksOmega commented Feb 26, 2024

The basics

The details

Resolves

Fixes #7864

Proposed Changes

Makes it so disposing is set at the beginning of the dispose and disposeInternal methods.

Reason for Changes

This way we can check isDeadOrDying in the dynamic connection plugin to get around issues with the dynamic connection plugin (see the linked issue for more detail).

Test Coverage

Updated incorrect tests.

Documentation

N/A

Additional Information

N/A

Breaking changes / To fix

The disposing property is now true from the start of the call to dispose on blocks. Whereas before, it would only be true after we had removed top blocks, change listeners, and done a few other actions. This means that isDeadOrDying returns true from the start of the call to dispose.

We think its unlikely that anyone was depending on the "delay" in the change to this value. So there is likely no work you need to do here. If you run into problems with this change, please let us know.

@github-actions github-actions bot added breaking change Used to mark a PR or issue that changes our public APIs. PR: fix Fixes a bug labels Feb 26, 2024
@BeksOmega BeksOmega marked this pull request as ready for review March 11, 2024 17:30
@BeksOmega BeksOmega requested a review from a team as a code owner March 11, 2024 17:30
@BeksOmega BeksOmega requested a review from cpcallen March 11, 2024 17:30
@github-actions github-actions bot removed PR: fix Fixes a bug breaking change Used to mark a PR or issue that changes our public APIs. labels Mar 11, 2024
@github-actions github-actions bot added breaking change Used to mark a PR or issue that changes our public APIs. PR: fix Fixes a bug labels Mar 11, 2024
@@ -795,7 +795,7 @@ export class BlockSvg
* E.g. does trigger UI effects, remove nodes, etc.
*/
override disposeInternal() {
if (this.isDeadOrDying()) return;
this.disposing = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am pretty sure that this one is redundant and can be removed, since you do a super call immediately and Block.prototype.disposeInternal also sets this.disposing = true.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, but to future-proof this (in case we ever add things before calling super) and make it extremely clear, I think it's reasonable to leave it in.

If this were more expensive I would remove it. But since it's cheap I think it's reasonable to leave.

@BeksOmega BeksOmega merged commit a5126d1 into google:rc/v11.0.0 Mar 13, 2024
9 checks passed
@github-actions github-actions bot added breaking change Used to mark a PR or issue that changes our public APIs. PR: fix Fixes a bug and removed PR: fix Fixes a bug breaking change Used to mark a PR or issue that changes our public APIs. labels Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Used to mark a PR or issue that changes our public APIs. PR: fix Fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants