Comments (13)
The error occurs here, and just in 2.12.0 they changed
public func onText(_ callback: @escaping (WebSocket, String) -> () {
self.onTextCallback = callback
}
at
@preconcurrency public func onText(_ callback: @Sendable @escaping (WebSocket, String) -> ()) {
self.onTextCallback.value = callback
}
from pioneer.
I'll look into it, thanks for reporting
from pioneer.
It worked fine on Chrome, but I did check that it does fails on Safari and Firefox. I think I narrowed it down to the fact non-Chromium browser doesn't like it when a single path / endpoint is used for http and websocket. I'll made an update where you have provide a separate WebSocket endpoint.
I didn't get the Precondition failed error in both cases though, the server runs with no issue. Although, I am no running the server in debug mode on Xcode.
from pioneer.
I think v1.2.2
fixes the issue, and WebSocket should work now in Firefox and Safari.
Although, if connecting to WebSocket using the same path for HTTP poses a problem, there's now the "/graphql/websocket"
endpoint that only handles WebSocket and should be more consistent.
Let me know if the precondition failure happen again, I have not been able to reproduce that exact error message, I'll close this issue by tommorow if everything works fine
from pioneer.
In Firefox and Safari now works. But the Precondition failed error is still there, I tried to run it in the terminal, it has the same error.
from pioneer.
Websocket-kit
version 2.11.0
has no Precondition failed
error, but no connection, apollo sandbox
gives error Unable to reach subscription server
from pioneer.
What version of websocket-kit
were you using before that gives the precondition errors?
from pioneer.
From version 2.12.0
the error Precondition failed
from pioneer.
I see, I haven't checked if Pioneer is working perfectly with the latest version of Vapor (and subsequently WebsocketKit). I assumed nothing should be breaking since it's not a major update.
from pioneer.
Cheers, I'll update the dependencies version Pioneer is using and fix the usage of that function
from pioneer.
yep current usage of the onText callback would fail because it is called from a Task
from pioneer.
Alright, I think v1.3.0
should resolve this issue. I bumped up all versions of dependencies for this library to their latest non-major. Unfortunately, I also have to drop support for Swift 5.5 since SwiftNIO and Vapor did the same
from pioneer.
Feel free to re-open this issue, if the problem still persist
from pioneer.
Related Issues (20)
- `websocketOnInit` has not been implemented
- Public structs have no public initialisers
- After pausing the websocket connection from Apollo iOS, it can't reconnect. HOT 12
- Documentation search is pointing to incorrect path HOT 2
- Better typing for payload HOT 1
- Improvement to Test HOT 1
- Improvement to optional spec-compliant HOT 4
- Field Resolve Middleware HOT 1
- VaporMiddleware responding incorrectly to all paths HOT 7
- Plugins
- Error: 'ConcurrentResolve' is only available in macOS 12 or newer HOT 4
- TestConsumer Improvement
- Subscription via gateway HOT 3
- Improvement to spec-compliant HOT 1
- Value null in data on errors HOT 8
- GraphQL together with gRPC HOT 4
- Support for the new Swift Universal HTTP types
- Does Pioneer support multiplexing subscriptions over one WebSocket connection? HOT 6
- Does Pioneer support subscriptions via SSE? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pioneer.