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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major/Remove Starscream and add Upstreams support #25

Merged
merged 7 commits into from
May 17, 2024

Conversation

Romixery
Copy link
Owner

Huge thanks to @stuartcamerondeakin For his PR to remove Starscream. This PR has been made on top of his PR.

Starscream has been removed 馃コ

The note inherited from @stuartcamerondeakin 's PR:

The starscream library doesn't correctly report an initial connection failure to the SwiftStomp when using the default TCPTransport.swift transport library, and despite there being two pending PRs daltoniam/Starscream#904 and daltoniam/Starscream#821 which both attempt to address the issue neither has been merged for 3 and 4 years each respectively. Hopes of this being resolved any time soon are not high.
This makes use of SwiftStomp in a production environment where connectivity needs to be ensured with adequate retries etc impossible.
The alternative if running on iOS 13+ is to use the NativeTransport.swift library internally, but that's just a very thin wrapper for Apple's URLSessionWebSocketTask, making the use of Starscream itself fairly redundant.
I've therefore removed the dependency on Starscream and have implemented the underlying WebSocket transport natively using URLSessionWebSocketTask. Surprise 馃帀!
This is a big PR but makes the library much more robust, simplifies some things and removes the dependency on Starscream which seems to have always been problematic at best.
Cases that have been tested:
- Initial connection failure to the websocket with automatic reconnection enabled works
- Connection drops on an existing connection also result in automatic reconnection attempts
- Messages are being sent to topics correctly and subscription continues to work as-is
- SPM dependency works, cocopods dependencies are not tested as we don't use that

Upstreams supports 馃槑

Now we can consume events, messages, and receipts using the upstream publishers. This is super useful when we want to use SwiftStomp in SwiftUI's projects.

@Romixery Romixery merged commit 2c71e62 into master May 17, 2024
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.

None yet

2 participants