swift-server-community / APNSwift

📱HTTP/2 Apple Push Notification Service built with swift - send push notifications to iOS, iPadOS, tvOS, macOS, watchOS, visionOS, and Safari!
Apache License 2.0
686 stars 103 forks source link

[BUG] Dependancy issue when adding to Vapor project #56

Closed handya closed 4 years ago

handya commented 4 years ago

After adding APNSwift to any of my Vapor 3.0.0 or 3.3.1 projects, using Swift package manger and then updating, half way through updating the packages, Swift package manager will hang and go to 100% cpu. I'm able to build and run APNSwift and Vapor project independently but when adding APNSwift to Vapor it hangs.

It also hangs when only adding swift-nio-http2 to a Vapor project. It did not hang when changing APNSwift dependencies versions to:

    dependencies: [
        .package(url: "https://github.com/apple/swift-nio", from: "1.0.0"),
        .package(url: "https://github.com/apple/swift-nio-ssl", from: "1.0.0"),
        .package(url: "https://github.com/apple/swift-nio-http2", .upToNextMinor(from: "0.1.0"))
    ],

To Reproduce Steps to reproduce the behavior:

  1. Add APNSwift to a Vapor project
    dependencies: [
        .package(url: "https://github.com/vapor/vapor.git", from: "3.0.0"),
        .package(url: "https://github.com/vapor/fluent-sqlite.git", from: "3.0.0"),
        .package(url: "https://github.com/kylebrowning/APNSwift.git", .upToNextMinor(from: "1.3.0"))
    ],
  2. Update dependancies.
  3. After updating a few packages Swift package manager should hang and go to 100% CPU on one thread.

Expected behavior Vapor project should update successfully project.

Platform:

Additional context Hopefully this is just me being dumb and not doing something correctly 🤞

kylebrowning commented 4 years ago

Hi @handya. This package will probably only work with Vapor 4. The hang is happening because of the swift tools package versions cc @tanner0101

I can't remember why exactly, and what would be needed to be done, but I don't believe NIO 2 works with Vapor 3.

weissi commented 4 years ago

Vapor 3 is unfortunately based on NIO 1. You'll only be able to use APNSwift together with Vapor 4.

handya commented 4 years ago

Ok, great, thanks for the info. I'll take a look at Vapor 4.

kylebrowning commented 4 years ago

Theres probably some commits before I went to NIO 2, can't find them currently, and I wouldn't recommend them, cause it's code from April that never went into production.

kylebrowning commented 4 years ago

Going to mark this as closed. Thanks.