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

Only mutate ManagedPlayerViewModel.loadingState on main thread #566

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ap-for-work
Copy link

Published properties in SwiftUI models should not be mutated on background threads.

Refactor ManagedPlayerViewModel.next to ensure all paths that update loadingState do so from the main thread.

Add unit tests to verify loadingState changes arrive on the main thread when next is called.

Change Type (required)

Indicate the type of change your pull request is:

  • patch
  • minor
  • major
  • N/A

Does your PR have any documentation updates?

  • Updated docs
  • No Update needed
  • Unable to update docs

Published properties in SwiftUI models should not be mutated on
background threads.

Refactor `ManagedPlayerViewModel.next` to ensure all paths that update
`loadingState` do so from the main thread.

Add unit tests to verify loadingState changes arrive on the main thread
when next is called.
Copy link

codecov bot commented Dec 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.79%. Comparing base (dc3c3ab) to head (fc2b28f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #566      +/-   ##
==========================================
- Coverage   89.70%   85.79%   -3.91%     
==========================================
  Files         331      186     -145     
  Lines       19794    10676    -9118     
  Branches     1948     1949       +1     
==========================================
- Hits        17756     9160    -8596     
+ Misses       2024     1502     -522     
  Partials       14       14              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Successfully merging this pull request may close these issues.

1 participant