Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 12, 2026

Summary

Addresses thread safety issue where hasStarted flag was being modified from background threads despite @MainActor annotation on the class.

Changes:

  • Replace direct hasStarted = false assignment in error handler with stop() call to ensure flag modification happens on main thread
  • All hasStarted modifications now properly dispatched to main thread via DispatchQueue.main.async or through @MainActor methods

Screenshots

N/A - Internal state management change with no UI impact

Link to pull request in Documentation repository

Documentation: home-assistant/companion.home-assistant#

Any other notes

This is a stacked PR that merges into #4213 to address review feedback from #4213 (comment)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Address feedback on simplify CameraView MPEG PR Fix thread safety for hasStarted flag in CameraMJPEGPlayerViewModel Jan 12, 2026
Copilot AI requested a review from bgoncal January 12, 2026 19:55
@bgoncal bgoncal marked this pull request as ready for review January 12, 2026 20:06
Copilot AI review requested due to automatic review settings January 12, 2026 20:06
@bgoncal bgoncal merged commit f54bc49 into Simplify-MJPEG-player Jan 12, 2026
2 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

@bgoncal bgoncal deleted the copilot/sub-pr-4213-again branch January 12, 2026 20:06
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.

2 participants