Skip to content
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

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

Open
nerdmed opened this issue Jun 18, 2015 · 13 comments
Open

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

nerdmed opened this issue Jun 18, 2015 · 13 comments

Comments

@nerdmed
Copy link

nerdmed commented Jun 18, 2015

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

@Wenape
Copy link

Wenape commented Jun 18, 2015

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).

@nerdmed
Copy link
Author

nerdmed commented Jun 18, 2015

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

@rbabayoff
Copy link
Member

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

@nerdmed
Copy link
Author

nerdmed commented Jun 18, 2015

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

@rbabayoff
Copy link
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.

@rbabayoff
Copy link
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.

@nerdmed
Copy link
Author

nerdmed commented Jun 18, 2015

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.

@rbabayoff
Copy link
Member

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

Reload.isWaitingForResume()

@rbabayoff
Copy link
Member

@nerdmed
Copy link
Author

nerdmed commented Jun 18, 2015

thanks a lot for sharing!

@ephemer
Copy link

ephemer commented Jun 22, 2015

@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)

@rbabayoff
Copy link
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.

@rbabayoff
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants