Skip to content

No session and user gets logged out after hot code reload #4

Open

Description

@nerdmed

Hey @rbabayoff,

first thanks providing this package. The WKWebView is somehow essential for newer hybrid apps.
However we noticed, that a hot code reload causes the user to get logged out and also deletes the session. I have tested it without your changes to the autoupdater and the package and it works.

Do have any experience with this issue or any solution?

Best,
Med

Activity

  1. Wenape commented on Jun 18, 2015

    @Wenape

    I've noticed the wkwebview doesn't like too many hot code pushes when running an app. In my case, about 2 hot code pushes would cause the app to eventually crash (usually triggered when backgrounding or resuming the app, with a memory error).

  2. nerdmed commented on Jun 18, 2015

    @nerdmed
    Author

    @Wenape yes i have also experienced this, any experience on the user account stuff?

  3. rbabayoff commented on Jun 18, 2015

    @rbabayoff
    Member

    ios, right? which version of ios and are you running safari in private mode?

  4. nerdmed commented on Jun 18, 2015

    @nerdmed
    Author

    Hey @rbabayoff, we are running on ios 8.3 - never changed something to the safari settings

  5. rbabayoff commented on Jun 18, 2015

    @rbabayoff
    Member

    I know. I thought it might be that safari and wkwebview share the same private mode setting, and in private mode you cannot access localStorage, which is what meteor relies on to re-login automatically after a hot code push, to my understanding.

  6. rbabayoff commented on Jun 18, 2015

    @rbabayoff
    Member

    In our use case, we use mdg:reload-on-resume, in order to avoid hot code pushes while the app is running, so this can be a workaround, for now. Just note that the Telerik wkwebview cordova plugin that this package depends on is a temporary workaround, until cordova officially supports it, so I do expect issues with it and would recommend just to notify the user that there is a new version and to restart the app. You can do it by using the following event from the meteor reload package:

    Reload._onMigrate

    Look at the meteor source code for documentation about it.

  7. nerdmed commented on Jun 18, 2015

    @nerdmed
    Author

    Ok i will check on the private mode of safari. Using reload on resume and logging in afterwards seems like the way to go for now.

  8. rbabayoff commented on Jun 18, 2015

    @rbabayoff
    Member

    Sorry, got confused. To know if there is a new version, the reload-on-resume package has a reactive data source:

    Reload.isWaitingForResume()

  9. nerdmed commented on Jun 18, 2015

    @nerdmed
    Author

    thanks a lot for sharing!

  10. ephemer commented on Jun 22, 2015

    @ephemer

    @rbabayoff please see Telerik-Verified-Plugins/WKWebView#104, especially the rundown in my comment at the bottom.

    Essentially, if one turns off the crash detection (As I argued in the other thread, it really should be off be default), there should be no more issues with hot code reload or with local storage. See the latest commits in Telerik's repo for the option to disable crash detection.

    It'd be great if you could merge these commits into your fork (or just comment out _crashRecoveryTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(recoverFromCrash) userInfo:nil repeats:YES]; in MyMainViewController.m)

  11. rbabayoff commented on Jun 25, 2015

    @rbabayoff
    Member

    Will do. Give me a couple of days. I also want to eliminate the need to add the cordova plugin before adding this package, since apparently the meteor bug that prevented me to do so disappeared.

  12. rbabayoff commented on Jul 16, 2015

    @rbabayoff
    Member

    Hey, I'm having build problems on iOS merging the latest telerik changes, due to them extracting the web server to a separate package. If you know Objectve C, help will be appreciated. Don't really have the time now to learn the depths of a new language and dig into xCode debugging.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions