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

iOS: Never queue application-level events #3905

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

madsmtm
Copy link
Member

@madsmtm madsmtm commented Sep 10, 2024

Events like resumed, new_events, about_to_wait, and so on will never happen as a result of programmer action, so we'll never need to queue those. This allows us to remove the need for the old Event struct in the iOS backend.

Furthermore, we can now remove InUserCallback, since that state is already stored inside EventHandler.

I've tried to otherwise keep the semantics as close to the original by calling handle_nonuser_events(mtm, []), which flushes pending events.

  • Tested on all platforms changed

@madsmtm madsmtm added DS - ios S - maintenance Repaying technical debt labels Sep 10, 2024
@madsmtm
Copy link
Member Author

madsmtm commented Sep 10, 2024

Incidentally, this improves #3714, but makes #3816 much worse - not quite sure why yet? But will fix it separately from this, see #3906

@madsmtm madsmtm force-pushed the madsmtm/uikit-cleanup-event-handling2 branch from b81218b to fb9cd26 Compare September 10, 2024 12:52
Copy link
Member

@kchibisov kchibisov left a comment

Choose a reason for hiding this comment

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

Commit should specify that it fixes specific issue you're talking about and you should have a changelog entry for it.

@madsmtm madsmtm added this to the Version 0.31.0 milestone Dec 3, 2024
@madsmtm madsmtm force-pushed the madsmtm/uikit-cleanup-event-handling2 branch from fb9cd26 to b4772ac Compare December 3, 2024 17:24
@madsmtm
Copy link
Member Author

madsmtm commented Dec 3, 2024

I would treat the fact that it fixes #3714 as more of a curiosity, not a true fix, there's still a bunch of things I need to do to fully fix that issue. But I have added a changelog entry.

@madsmtm madsmtm requested a review from kchibisov December 3, 2024 17:26
Copy link
Member

@kchibisov kchibisov left a comment

Choose a reason for hiding this comment

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

I would treat the fact that it fixes #3714 as more of a curiosity, not a true fix, there's still a bunch of things I need to do to fully fix that issue. But I have added a changelog entry.

In this case it shouldn't matter and it's better without it. And saying that it fixes it should be removed, since it's not as you say.

@madsmtm madsmtm force-pushed the madsmtm/uikit-cleanup-event-handling2 branch from b4772ac to cab5487 Compare December 3, 2024 17:35
@madsmtm
Copy link
Member Author

madsmtm commented Dec 3, 2024

Sure, I've updated the comment

@kchibisov
Copy link
Member

Does the changelog entry really matter at this point? Maybe just drop it, since it's an implementation detail. I thought that you've fixed the issue meaning that you'd close it with a changelog entry, but if it's not fixed, then changelog entry doesn't really matter.

@madsmtm
Copy link
Member Author

madsmtm commented Dec 3, 2024

That's why I didn't have a changelog entry in the first place ;)

But I think there is value in keeping the entry, while this is an implementation detail, it can be useful for users to know if something were to go wrong with it.

Copy link
Member

@kchibisov kchibisov left a comment

Choose a reason for hiding this comment

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

I just don't see how it's actionable or solves issues, and I've asked for changelog only because you've said that it fixes some old bug. I'll leave it up to you though.

@madsmtm madsmtm force-pushed the madsmtm/uikit-cleanup-event-handling2 branch from cab5487 to 26db97a Compare December 3, 2024 18:03
Events like `resumed`, `new_events`, `about_to_wait`, and so on will
never happen as a result of programmer action, so we'll never need to
queue those. This allows us to remove the need for the old `Event`
struct in the iOS backend.

Furthermore, we can now remove `InUserCallback`, since that state is
already stored inside `EventHandler`.

I've tried to otherwise keep the semantics as close to the original by
calling `handle_nonuser_events(mtm, [])`, which flushes pending events.
@madsmtm madsmtm force-pushed the madsmtm/uikit-cleanup-event-handling2 branch from 26db97a to 9984443 Compare December 3, 2024 18:03
@madsmtm
Copy link
Member Author

madsmtm commented Dec 3, 2024

Well, at the very least it should improve performance (once #3816 is also resolved), just because we do less. So just for that reason, the changelog entry is nice.

@madsmtm madsmtm merged commit 4d2a0dd into master Dec 3, 2024
58 checks passed
@madsmtm madsmtm deleted the madsmtm/uikit-cleanup-event-handling2 branch December 3, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DS - ios S - maintenance Repaying technical debt
Development

Successfully merging this pull request may close these issues.

2 participants