NativeScript / NativeScript/nativescript-cli

Exception will throw if you open URL with delay

Open
#3,637 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

backlog bug debug os: android to-be-checked
Dominant language
JavaScript
Stars
1.1k
Forks
204
Avg merge
1d 9h
Merged PRs (30d)
8

Description

Tell us about the problem

exception will throw if you open URL with delay

Which platform(s) does your issue occur on?

Android

Please provide the following version numbers that your issue occurs with:
  • CLI: 4.1.0-rc
  • Runtime(s): 4.1.1-rc
Please tell us how to recreate the issue in as much detail as possible.
  1. tns create app
  2. tns debug android
    Please don't open the URL. Open it after 10 min(for example). You will see the following exception:
System.err: java.io.IOException: Broken pipe
System.err: 	at android.net.LocalSocketImpl.write_native(Native Method)
System.err: 	at android.net.LocalSocketImpl.-wrap2(Unknown Source:0)
System.err: 	at android.net.LocalSocketImpl$SocketOutputStream.write(LocalSocketImpl.java:154)
System.err: 	at fi.iki.elonen.NanoWSD$WebSocketFrame.write(NanoWSD.java:700)
System.err: 	at fi.iki.elonen.NanoWSD$WebSocket.sendFrame(NanoWSD.java:271)
System.err: 	at fi.iki.elonen.NanoWSD$WebSocket.close(NanoWSD.java:135)
System.err: 	at fi.iki.elonen.NanoWSD$WebSocket.handleCloseFrame(NanoWSD.java:184)
System.err: 	at fi.iki.elonen.NanoWSD$WebSocket.handleWebsocketFrame(NanoWSD.java:218)
System.err: 	at fi.iki.elonen.NanoWSD$WebSocket.readWebsocket(NanoWSD.java:246)
System.err: 	at fi.iki.elonen.NanoWSD$WebSocket.access$200(NanoWSD.java:65)
System.err: 	at fi.iki.elonen.NanoWSD$WebSocket$1.send(NanoWSD.java:88)
System.err: 	at fi.iki.elonen.NanoHTTPD$HTTPSession.execute(NanoHTTPD.java:1011)
System.err: 	at fi.iki.elonen.NanoHTTPD$LocalClientHandler.run(NanoHTTPD.java:251)
System.err: 	at java.lang.Thread.run(Thread.java:764)

another case to reproduce this exception is:

  1. tns create app
  2. tns debug android
  3. copy URL from terminal and open 2 tabs.
  4. close the second tab and you will see the exception.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with tns create app and tns debug android, including the delayed URL and two-tab cases. Start from the NanoWSD.java and NanoHTTPD.java stack frames, then trace how the Android debug flow handles a closed or delayed connection. Done means these scenarios no longer produce the reported broken-pipe exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java, javascript
Domain
cli, mobile-dev, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.