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

Silently return rather than throwing when performing mutations on disposed drawables #5534

Merged
merged 4 commits into from
Nov 25, 2022

Conversation

peppy
Copy link
Member

@peppy peppy commented Nov 22, 2022

A common pain point in test and production failures, which isn't really protecting us from incorrect usage. I think it makes more sense not to throw in these scenarios.

Example of a failure: https://github.com/ppy/osu/actions/runs/3511604121/jobs/5882531098

We would usually fix these by adding a Schedule inline, but this can potentially cause other unforeseen issues in normal usage (frame delay; events not running due to alive state etc). We've added such schedules in countless places.

Interested in thoughts of those marked for review (and anyone else that cares enough). Also please check through each exception to make sure you agree with all the removed ones. I've left some which make sense to keep around.

@peppy peppy force-pushed the dont-throw-on-disposed branch from 2eb71bf to d9a554f Compare November 22, 2022 11:56
@peppy
Copy link
Member Author

peppy commented Nov 22, 2022

There's a couple of test failures I'm unsure about, needs further investigation.

Copy link
Collaborator

@bdach bdach left a comment

Choose a reason for hiding this comment

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

I don't see a huge reason not to.

Copy link
Contributor

@smoogipoo smoogipoo left a comment

Choose a reason for hiding this comment

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

I find this a little bit scary, but I guess we can try it and see what/how things blow up.

@peppy peppy enabled auto-merge November 25, 2022 09:58
@peppy peppy merged commit 07acced into ppy:master Nov 25, 2022
@peppy peppy deleted the dont-throw-on-disposed branch December 1, 2022 04:01
Copy link
Member

@frenzibyte frenzibyte left a comment

Choose a reason for hiding this comment

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

Looking at the specific case mentioned in OP, I'm interested to know what's trigging the value change, since a drawable usually unbinds all of its bindables before disposal. But that being said, I can't think of that being potentially bad to cause issues hiding behind us, so I'm not completely against this change.

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

Successfully merging this pull request may close these issues.

4 participants