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

Address UI race conditions #229

Merged
merged 6 commits into from
Oct 13, 2022
Merged

Address UI race conditions #229

merged 6 commits into from
Oct 13, 2022

Conversation

keeshux
Copy link
Member

@keeshux keeshux commented Oct 13, 2022

This is the very first attempt at resolving race conditions due to UI updates coming from non-main actor. SwiftUI behavior is not fully transparent when it comes to the new Concurrency framework.

The PR clutters code with countless @MainActor annotations, but as a start, better be safe than sorry.

- IntentsManager: @mainactor, non-shared, continuation

- SSIDReader: @mainactor, continuation

- Reviewer: main queue, non-shared
There were background thread calls e.g. in VPNToggle, because
ProfileManager was used inside a VPNManager async call.

Annotate @mainactor wherever a Task involves UI.
@keeshux keeshux added the bug Something isn't working label Oct 13, 2022
@keeshux keeshux added this to the 2.1.0 milestone Oct 13, 2022
@keeshux keeshux self-assigned this Oct 13, 2022
@keeshux keeshux force-pushed the actor-race-conditions branch from 785fc78 to ea164c0 Compare October 13, 2022 06:38
@keeshux keeshux force-pushed the actor-race-conditions branch from ea164c0 to 22a676d Compare October 13, 2022 06:38
@keeshux keeshux modified the milestones: 2.1.0, 2.0.1 Oct 13, 2022
@keeshux keeshux merged commit 5627e6c into master Oct 13, 2022
@keeshux keeshux deleted the actor-race-conditions branch October 13, 2022 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant