GithubHelp home page GithubHelp logo

valor-software / nativescript-plugins Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 4.0 9.11 MB

nativescript-plugins

License: MIT License

Shell 0.82% TypeScript 39.61% SCSS 0.15% HTML 1.27% JavaScript 2.90% Ruby 0.11% Objective-C 53.67% C 1.03% CSS 0.45%

nativescript-plugins's People

Contributors

adamatri avatar edusperoni avatar mukaschultze avatar nathanwalker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nativescript-plugins's Issues

Sockets get lost/stuck during communication

Hi there and thanks for your work.

I opened this to describe a very strange behaviour of the nativescript-websockets plugin where i cannot really explain what and where the bug lies, but maybe someone here might have the right idea. Or it might point to a bug somewhere in the software stack. Since it is a rather complex scenario i don't know if i can provide a minimal code example.

We use websockets to communicate between a web-app and a nativescript app and xchange data in an encrypted way. There are severeal messages included in a bidirectional way.
After initiating the communication it just stops at some point. Browser and Relay-Server are sending the message but the app just doesn't receive it. There is no error, no timeout, just waiting for the next message.
It mostly stops if a message is not sent immediately, which might happen during the first automatic steps. But it always happens at a message we only sent after human interaction in the browser app. Thus we firstly assumed issues with timeouts, but weren't able to find any timeout which would stop the communication silently. We also don't configure any.
During my attempts to figure out what happens, i noticed the "strange" behaviour mentioned.

I added a subscrption to monitor the socket reference:

interval(1000).subscribe(() => {
            console.log("This socket: ", this.socket);
        });

But instead of seeing more information about the problem, it just works. oO
I reproduced this several times and also on both platforms: android and ios.

We have a class encapsulating the websocket reference and details of our protocol.
This class also constructs the Socket and is adding the Eventhandlers.
That "floating" subscribtion above is added after creation of the socket.

This behaviour was introduced during upgrades from ns6 to ns8 which also includes switching to this nativescript-websocket-implementation. The ns6 variant works without this behaviour. The typescript code didn't change except for some minor changes due to the upgrade.

As said, i don't really have an idea where this fails, and after days of diggin i fear i never will find one.
I assume that somehow the reference or the thread waiting for the next message gets suspended without waking up anymore or collected or some other stuff which shouldn't happen and that that floating subscription somehow prevents that since it changes how the code is interpreted by the runtime.

For the time i will live with this hack, without sleeping well though.
But as said this might point to other problems in the stack.

Thanks
legion

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.