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 route lines when connectivity returns #138

Closed
sgdoerfler opened this issue Dec 22, 2014 · 17 comments
Closed

No route lines when connectivity returns #138

sgdoerfler opened this issue Dec 22, 2014 · 17 comments

Comments

@sgdoerfler
Copy link

Go to airplane mode, then start the app. You get a map, but no RT info of course. Now leave airplane mode. The bus icons appear on the map after a few seconds, but the route lines do not, even waiting several minutes. Rotating the device to change its orientation makes them come back. 2.95B.

I also saw the missing-route-lines issue once after the device had powered down due to inactivity, but haven't been able to reproduce that case.

@RitwikGupta
Copy link
Member

Weird. We'll look into that, thanks. Having a lot of problems with losing connectivity at any point in the life cycle.

@epicstar
Copy link
Member

This currently what I expect to happen btw.... This has to be done this way otherwise the asynctask gets stuck forever in limbo which will freeze the app otherwise. Any connection timeout has to either be recycled or reloaded and that could possibly break the app (like it already did before I did this)

@epicstar
Copy link
Member

I think the only solution is to have a reload button honestly. The reason why the missing route lines issue happened is most likely because the device wasn't receiving internet.

@epicstar
Copy link
Member

If there are suggestions we can do within the asynctask, it'd be nice

@sgdoerfler
Copy link
Author

It looks like you can detect when the connectivity state changes.
http://developer.android.com/training/monitoring-device-state/connectivity-monitoring.html#MonitorChanges
So maybe whenever you get a CONNECTIVITY_ACTION, check to see if the async task has exited with an IOException instead of returning the data. It so, restart the async task. (Or maybe something vaguely like
if (stillNeedData() && !asyncTaskRunning()) restartAsyncTask().)

Or maybe have the IOException code in that async task request getting a CONNECTIVITY_ACTION, then respond to it by restarting the async task. Or perhaps the caller of the async task notices it got no data back, and handles restarting it when a CONNECTIVITY_ACTION comes in.

@epicstar
Copy link
Member

Route calls should be reduced using #149.... Please report issues if there are problems in 3.2 (beta)

@sgdoerfler
Copy link
Author

As expected, in 3.2 it's now harder to make this bug show up. New steps are:

  1. Switch to Airplane mode (or otherwise lose connectivity).
  2. Clear Transit, then select some routes.
  3. Restore connectivity.

The bus icons then appear, but the route lines and stops do not. Switching to the home screen and back to the app makes them appear.

@epicstar
Copy link
Member

I can only fix this atm by pressing "Clear Transit" and then selecting the route lines when internet activity is restored. I will make a new method to close the whole app when there's no internet but for now, I'll leave it as is...

@sgdoerfler
Copy link
Author

I'm not sure forcing the app to exit would be better than the current behavior, where I can always manually exit and restart the app. It's happened that the app gets some info I care about, and then while it's trying to retrieve some other info (say, list of stops for a route that might even be off the map now), I move out of range of the Wifi signal and get the message at the bottom that there's a problem. Right now, I can use the data it managed to retrieve successfully. Forcing the app to quit at that point would lose whatever data it's already retrieved.

I suggest just leaving it alone, unless you can find a way to have the routes update once the network comes back up. (But it might be OK if "network is now back up" caused the app to reload itself.)

@epicstar
Copy link
Member

It'd be very possible to do that, but I would have to re-make the whole "retrieve route lines" task to use volley. It'll be an interesting task..........

@epicstar
Copy link
Member

epicstar commented Dec 6, 2015

Don't think the fix will be a fix in this sense...

@epicstar
Copy link
Member

Going to reopen this issue. I got this working with bus updates, so I'm going to do the same mechanism for the route lines.

@epicstar epicstar reopened this May 10, 2016
@epicstar epicstar added this to the 8.0.0 Release Milestone milestone Jul 1, 2016
@epicstar
Copy link
Member

epicstar commented Jul 1, 2016

This is a direct cousin of #267 and requires #196

@sgdoerfler, this will be fixed in release 8.0.0

@epicstar
Copy link
Member

I'm actually going to close this issue now. We can actually improve the app via #301. It won't make it to the 8.0.0 release but the current behavior without fixing this issue is already what we have right now.

@epicstar
Copy link
Member

epicstar commented Apr 1, 2017

@sgdoerfler, this issue is going to be fixed in #316. Pretty much, all routes are downloaded from the TrueTime API at build time and then saved to the assets folder of the app. I know I had a concern about doing this from the TrueTime license, but it should be ok regardless.

@epicstar epicstar reopened this Apr 1, 2017
@epicstar epicstar removed the wontfix label Apr 1, 2017
@epicstar
Copy link
Member

Released with 8.0.0b3. Thanks @sgdoerfler for bringing up this issue.

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

3 participants