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

Cannot access app offline after hard close #1566

Closed
abbyad opened this issue Nov 13, 2015 · 26 comments
Closed

Cannot access app offline after hard close #1566

abbyad opened this issue Nov 13, 2015 · 26 comments
Labels
Type: Bug Fix something that isn't working as intended

Comments

@abbyad
Copy link
Contributor

abbyad commented Nov 13, 2015

Quoting @joshnesbit from #1343 (comment):

I'm offline on my Android device (Nexus LG phone). App was already open (from previous load), and I was able to add a family / see the family. Switching to tasks tab showed the red error message for error loading tasks. Hard closed, tried opening, and saw the white error screen. Couldn't access lg.app URL, with the following error message: net::ERR_NAME_NOT_RESOLVED

Can others confirm they're able to use the app on the Y4s, after a hard close?

When I test this I get Webpage not available.

@abbyad abbyad added Type: Bug Fix something that isn't working as intended 1 - Scheduled Priority: 1 - High Blocks the next release. labels Nov 13, 2015
@alxndrsn
Copy link
Contributor

Same behaviour observed here.

@mandric
Copy link
Contributor

mandric commented Nov 13, 2015

Seems to work fine for me on Samsung SIII:

  1. load app (based on lg.dev) and view some contacts/tasks
  2. close out app so it's not running in background
  3. turn off mobile and wifi data
  4. start app again and it loading contacts/tasks seems normal

@mandric
Copy link
Contributor

mandric commented Nov 13, 2015

Let me try adding a family...

@ghost
Copy link

ghost commented Nov 13, 2015

Are you turning off the 802.11 and cellular radios entirely, or just disabling data?

@alxndrsn
Copy link
Contributor

I'm turning off wifi; no SIM card present. Working on lg.dev but not on lg.app.

@mandric
Copy link
Contributor

mandric commented Nov 13, 2015

Adding family works fine too.

I turned off/disabled wifi and mobile data. That doesn't turn off cell radio completely but disables data functionality. I can try airplane mode too...

@mandric
Copy link
Contributor

mandric commented Nov 13, 2015

Experience in airplane mode was equivalent (basic testing worked).

@abbyad
Copy link
Contributor Author

abbyad commented Nov 13, 2015

@mandric, what chrome/webview version do you have on the S3?

@mandric
Copy link
Contributor

mandric commented Nov 13, 2015

SAMSUNG-SGH-I747
WebView in org.medicmobile.webapp.mobile.livinggoods (Version/4.0 Chrome/30.0.0.0)

@mandric
Copy link
Contributor

mandric commented Nov 13, 2015

Sorry let me clarify, this testing was using the livinggoods app (branded app) built from latest medic-android and using a fixed_app_url (in src/livinggoods/res/values/strings.xml) of https://lg.app.medicmobile.org.

@ghost
Copy link

ghost commented Nov 13, 2015

If you open the Chrome remote debugger with the error page pulled up and the phone offline, doing the following on the Javascript console seems to get the app to start:

window.location = 'https://lg.app.medicmobile.org/medic/_design/medic/_rewrite/';

Is it possible that the container application just needs a trailing slash on the default URL? That's obviously not the correct™ fix, but might point us to an issue with base URL handling in the app.

mandric pushed a commit to medic/cht-android that referenced this issue Nov 13, 2015
@mandric
Copy link
Contributor

mandric commented Nov 14, 2015

Verified this works from the app store now:

  1. Totally uninstall everything LG-related.
  2. Install the LG app from the play store.
  3. Start it online and let it bootstrap / replicate until you see all of the usual contacts.
  4. Hard close the app.
  5. Take the phone entirely offline at the OS level.
  6. Start the app.
  7. Observe there is no Webpage not available error and app works normally.

@joshnesbit
Copy link

@mandric, I followed your directions on my Y4 and see this at step 7:

opening app offline

@mandric
Copy link
Contributor

mandric commented Nov 14, 2015

OK @joshnesbit re-opening. Surprised because the trailing slash shows up in the error too.

@mandric
Copy link
Contributor

mandric commented Nov 14, 2015

Anyone else with a Y4 want to give this a test?

@joshnesbit
Copy link

Hey @mandric, this is strange! I just got this to work three times in a row on my Y4. The app loads and works fine after a hard close. The screenshot above was what I saw 3 hours ago – but it's working now.

@mandric
Copy link
Contributor

mandric commented Nov 15, 2015

Yeah that is strange, especially because the error showed the trailing slash. I thought maybe you got an old build somehow but on the old builds the error was without the trailing slash. Maybe we'll try to reproduce on more devices and maybe should add some logging if it continues.

@alxndrsn
Copy link
Contributor

(closed in error - waiting for code review)

@garethbowen
Copy link
Member

Assigned to @estellecomment for code review.

@estellecomment
Copy link
Contributor

That added slash LGTM. Thankfully 3 months was enough code review time to be really sure of it.

@sglangevin
Copy link

This is working well after having tried disabling data connection both before and after hard-closing the app. Moving to Ready.

@sglangevin sglangevin removed their assignment Nov 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Fix something that isn't working as intended
Projects
None yet
Development

No branches or pull requests

7 participants