Code Monkey home page Code Monkey logo

Comments (8)

saiHemak avatar saiHemak commented on May 22, 2024 1

created PR apple/swift-corelibs-foundation#2061

from kiturakit.

djones6 avatar djones6 commented on May 22, 2024

@Andrew-Lees11 could you document the double invocation of the callback you found from URLSession.dataTask when Kitura sends a 401: Unauthorized response? And also link to the StackOverflow issue you found which is likely to be the same / related to this.

I wonder if this is somehow related to apple/swift-corelibs-foundation#1569 - in which case maybe @saiHemak could investigate?

from kiturakit.

Andrew-Lees11 avatar Andrew-Lees11 commented on May 22, 2024

I created a gist that would recreate the test failure here.

When a Kitura server returns a 401 unauthorized code the callback on URLSession.dataTask is called twice. once with "The operation could not be completed" and then with the response from Kitura. This is not true for other error codes and only happens on Swift 5 on Linux.

I think This Stackoverflow error May be running into the same problem since it is only failing on Linux but i'm not entirely sure.

from kiturakit.

saiHemak avatar saiHemak commented on May 22, 2024

Could successfully recreate the issue from TestFoundation. Upon instrumenting the code I could see the TaskRegistry.remove is getting called twice . Instrumenting further to identify why the remove call has been triggered twice ..

from kiturakit.

pushkarnk avatar pushkarnk commented on May 22, 2024

@saiHemak this seems to be reported over Twitter too https://twitter.com/mxcl/status/1111073495017029635

from kiturakit.

saiHemak avatar saiHemak commented on May 22, 2024

session.taskRegistry.remove(task) has been called twice once from urlProtocol(`protocol`, didFailWithError: urlError) and the from the switch case case .dataCompletionHandler(let completion):

from kiturakit.

ianpartridge avatar ianpartridge commented on May 22, 2024

Please open an issue to track re-enabling these tests once Swift 5.0.1 ships with the fix.

from kiturakit.

Andrew-Lees11 avatar Andrew-Lees11 commented on May 22, 2024

Raised an issue to uncomment the tests here

from kiturakit.

Related Issues (9)

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.