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

Use StarScream branch which prevents multiple URLSession creation #57

Merged
merged 2 commits into from
Apr 3, 2024

Conversation

bgoncal
Copy link
Member

@bgoncal bgoncal commented Mar 27, 2024

StarScream seems to be creating one URLSession per request, which is against Apple's recommendation of reusing existing URLSession.
Besides that apparently this also has a consequence of in a "retry loop" in Home Assistant App, user may never be able to reconnect due to error POSIXErrorCode(rawValue: 28): No space left on device) which comes from the limit of URLSession's allowed.

Related issue: home-assistant/iOS#2638
My PR to StarScream: daltoniam/Starscream#1011

@bgoncal bgoncal self-assigned this Mar 27, 2024
@robbiet480
Copy link
Member

This doesn't block the merge but probably best to move the Starscream fork into the HA GitHub org

Copy link

codecov bot commented Mar 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.87%. Comparing base (8d1361d) to head (560c62a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #57   +/-   ##
=======================================
  Coverage   99.87%   99.87%           
=======================================
  Files          50       50           
  Lines        1595     1598    +3     
=======================================
+ Hits         1593     1596    +3     
  Misses          2        2           

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

@@ -124,6 +124,8 @@ internal class HAResponseControllerImpl: HAResponseController {
case let .error(error):
HAGlobal.log(.error, "Error: \(String(describing: error))")
phase = .disconnected(error: error, forReset: false)
case .peerClosed:
HAGlobal.log(.info, "Peer closed")
Copy link
Member Author

@bgoncal bgoncal Mar 27, 2024

Choose a reason for hiding this comment

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

Should I move phase to disconnected? (This new case comes from upgrading starscream from 4.0.4 to 4.0.6)

@bgoncal bgoncal merged commit 7405049 into main Apr 3, 2024
5 checks passed
@bgoncal bgoncal deleted the starscream-fix branch April 3, 2024 00:10
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.

2 participants