Skip to content

Unresponsive App after livesync #3545

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
triniwiz opened this issue Apr 23, 2018 · 10 comments
Open

Unresponsive App after livesync #3545

triniwiz opened this issue Apr 23, 2018 · 10 comments

Comments

@triniwiz
Copy link
Member

Please, provide the details below:

Did you verify this is a real problem by searching the NativeScript Forum and the other open issues in this repo?

Which platform(s) does your issue occur on?

iOS

Please provide the following version numbers that your issue occurs with:

  • CLI: 4.0.0
  • Cross-platform modules: 4.0.0
  • Runtime(s): 4.0.1
  • Plugin(s):
"nativescript-advanced-webview": "^2.0.0",
    "nativescript-angular": "5.3.0",
    "nativescript-audio": "~4.0.3",
    "nativescript-couchbase": "^1.0.18",
    "nativescript-downloader": "^1.1.0",
    "nativescript-email": "^1.4.2",
    "nativescript-exoplayer": "^3.3.2",
    "nativescript-google-analytics": "^0.4.1",
    "nativescript-image-cache-it": "^3.0.0",
    "nativescript-iqkeyboardmanager": "^1.1.0",
    "nativescript-ngx-fonticon": "~4.0.0",
    "nativescript-pager": "^7.0.9",
    "nativescript-permissions": "~1.2.3",
    "nativescript-ui-core": "^1.0.0",
    "nativescript-ui-listview": "^3.5.0",
    "nativescript-ui-sidedrawer": "^3.5.0",
    "nativescript-videorecorder": "^3.0.0-alpha.6",
    "nativescript-webkit-webview": "1.0.4",
    "nativescript-zip": "^2.0.4",

Please tell us how to recreate the issue in as much detail as possible.

After a couple livesync the app becomes unresponsive then I will need to do one of the following
hard close the app (fails to reopen sometimes) , hard close + uninstall or try updating one of the components until the app restarts then repeat the above steps until the eod

@Fatme
Copy link
Contributor

Fatme commented Apr 24, 2018

Hi @triniwiz,

Thank you for reporting this issue. Can you please give us more information about your problem?
Are you using simulator or real iOS device?
Can you please execute the command with --log trace option and send us the output?

@triniwiz
Copy link
Member Author

I've only tested on the simulator -> log.txt

@Fatme
Copy link
Contributor

Fatme commented Apr 26, 2018

Hi @triniwiz,

Thank you for providing the log.

I investigated it but was not able to reproduce the problem. I tried to add all your plugins to the application and tried to do different changes but the changes are successfully applied on the simulator every time.

If you could provide a sample application, which illustrates the issue, that would be extremely helpful. Or if you noticed some specific actions or sequence of specific actions that leads to this behaviour, it would be great appreciated to share it with us.

I can suggest you to try to executed the command on different iOS simulator. You need the followings:

  1. Execute tns device ios --available-devices - This will print you all available simulators
  2. Copy the device identifier
  3. Execute tns run ios --device <device identifier>

I've noticed sometimes on my side unexpected behaviour from simulator itself. This leads to leaked processes on simulator. It usually gets fixed after restrarting my machine. I can suggest you to try it on your side.

@sammoore
Copy link

sammoore commented May 2, 2018

I am facing the same issue after implementing some before-prepare, after-prepare, and before-watch hooks that writes files -- and based on the logs supplied above, it appears @triniwiz also had a custom hook running, with output stating that was copying the entitlements file.

However, my environment is pre-4.0:

  • CLI: 3.4.3
  • tns-core-modules: 3.4.1
  • Runtime(s): 3.4.1

After starting the app with tns run ios, making a modification to a file that will cause another file to be written to during the before-prepare hook will cause 2 syncs (first with the user modified file, second with the hook modified file). The second sync occurs just after a refresh was triggered, at which point the CLI stalls. Exiting the simulator causes the CLI to become responsive again.

I've also noticed in my environment that Android does not suffer from this issue; the app refreshes twice no problem. I cannot share my current project but time permitting I can try to produce a sample project. Hope this helps.

EDIT: Sounds possibly related to #3410

@triniwiz
Copy link
Member Author

triniwiz commented May 2, 2018

@samtheprogram you're correct I forgot about that => hook

@farfromrefug
Copy link
Contributor

same thing here with tns 4.0.1.

@sammoore
Copy link

sammoore commented May 3, 2018

As a workaround (cc: @triniwiz) I have require'd an external file from each _relevant _ hook (any that writes a file that would trigger a refresh) and store a written/saved boolean to ensure I only write the file once; this, of course, drops support for LiveSync on the relevant files unfortunately..

This works for us because the relevant file isn't code or modified often, and we can settle with those files just being copied when initially executing tns run ios, and when we do edit them, we have to restart LiveSync for the time-being.

@Fatme
Copy link
Contributor

Fatme commented May 9, 2018

Hi @triniwiz, @samtheprogram, @farfromrefug

Sorry for the late reply.

I didn't notice the app has a custom hook. I added it to the application and was able to reproduce the problem. It seems like a bug but we need more time to investigate it. We'll try to provide a solution ASAP.

@triniwiz,
{N} CLI respects app.entitlements files from App_Resources folder and from installed plugins. {N} CLI will merge all app.entitlements files from plugins and from App_Resources folder and will produce a single app.entitlements file under platforms folder.
Meanwhile, as a workaround, I can suggest you to remove nativescript-custom-entitlements plugin and try to run the application.
Let's us know if this works on your side.

@sean-perkins
Copy link

@Fatme I can confirm that deleting the custom hook does "resolve" the issue with the livesync locking up. Obviously this is a short-term resolution for development, but not ideal for continuing to support for production releases.

Fatme added a commit to telerik/mobile-cli-lib that referenced this issue May 17, 2018
Fatme added a commit that referenced this issue May 17, 2018
Fatme added a commit that referenced this issue May 17, 2018
@jeremypele
Copy link

I confirm on my side that custom hooks does break the livesync functionnaly on {N} 4.1 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants