Giter VIP home page Giter VIP logo

Comments (13)

ZirgVoice avatar ZirgVoice commented on June 24, 2024 1

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.

d-exclaimation avatar d-exclaimation commented on June 24, 2024

I'll look into it, thanks for reporting

from pioneer.

d-exclaimation avatar d-exclaimation commented on June 24, 2024

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.

d-exclaimation avatar d-exclaimation commented on June 24, 2024

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.

ZirgVoice avatar ZirgVoice commented on June 24, 2024

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.
Bildschirmfoto 2023-06-14 um 10 12 29

from pioneer.

ZirgVoice avatar ZirgVoice commented on June 24, 2024

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.

d-exclaimation avatar d-exclaimation commented on June 24, 2024

What version of websocket-kit were you using before that gives the precondition errors?

from pioneer.

ZirgVoice avatar ZirgVoice commented on June 24, 2024

From version 2.12.0 the error Precondition failed

from pioneer.

d-exclaimation avatar d-exclaimation commented on June 24, 2024

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.

d-exclaimation avatar d-exclaimation commented on June 24, 2024

Cheers, I'll update the dependencies version Pioneer is using and fix the usage of that function

from pioneer.

d-exclaimation avatar d-exclaimation commented on June 24, 2024

yep current usage of the onText callback would fail because it is called from a Task

from pioneer.

d-exclaimation avatar d-exclaimation commented on June 24, 2024

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.

d-exclaimation avatar d-exclaimation commented on June 24, 2024

Feel free to re-open this issue, if the problem still persist

from pioneer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.