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

Quest Search icons sometimes get stuck onscreen #1821

Closed
peternewman opened this issue May 8, 2020 · 16 comments
Closed

Quest Search icons sometimes get stuck onscreen #1821

peternewman opened this issue May 8, 2020 · 16 comments

Comments

@peternewman
Copy link
Collaborator

peternewman commented May 8, 2020

Quest Search icons sometimes get stuck onscreen

How to Reproduce
I think it's if you go offline while performing a quest search, that icon stays stuck onscreen. In this state if you subsequently perform another quest search it says you can't as you're offline, but the stuck icon doesn't disappear. You have to wait until you're online again to clear it.

Edit: start a search, switch away from SC, turn off WiFi, return to SC does the trick for me.

Versions affected
Android 9.0 SC v19.1

@peternewman peternewman added the bug label May 8, 2020
@westnordost westnordost added feedback required more info is needed, issue will be likely closed if it is not provided and removed feedback required more info is needed, issue will be likely closed if it is not provided labels May 8, 2020
@westnordost
Copy link
Member

Can confirm

@westnordost
Copy link
Member

westnordost commented May 8, 2020

Hm, actually it is not stuck. It is still downloading. The icon will vanish as soon as the download really stops, and that is when the request times out.
The downloader is oblivious of the fact whether the smartphone is connected or not. If it is not connected, it will simply timeout.

Edit: But of course, the download is only started when the device is connected.

@westnordost
Copy link
Member

The downloader could listen to connectivity changes and actively cancel the download, that would make the icon (and the download) go away immediately when connection is lost. But I think this would be quite bad for people with an unstable connection(?)

Another option is to reduce the timeout. However, the reason why downloads are not practically instant is not because there is a lot of data being downloaded but because the Overpass API takes some time to answer, sometimes for certain quests, quite long. So, setting the timeout to something short will also not be a good idea.

Do you have any idea how else to solve or mitigate this? Otherwise this'd be a will-not-fix.

@westnordost westnordost added the feedback required more info is needed, issue will be likely closed if it is not provided label May 8, 2020
@smichel17
Copy link
Member

Off the top of my head: if the connection is lost, offer a way to manually cancel the search (or always?). Or just hide the indicator and disable the ability to start searching in a new location -- maybe that's also a good place to put a notice that there's no connectivity ("Can't scan for quests when offline").

@peternewman
Copy link
Collaborator Author

The downloader could listen to connectivity changes and actively cancel the download, that would make the icon (and the download) go away immediately when connection is lost. But I think this would be quite bad for people with an unstable connection(?)

Yes I think I'd agree there.

Another option is to reduce the timeout. However, the reason why downloads are not practically instant is not because there is a lot of data being downloaded but because the Overpass API takes some time to answer, sometimes for certain quests, quite long. So, setting the timeout to something short will also not be a good idea.

What is the current timeout? I was still seeing it stuck onscreen after 10s of minutes wandering around offline.

Do you have any idea how else to solve or mitigate this? Otherwise this'd be a will-not-fix.

Perhaps fade out/background when offline?

Off the top of my head: if the connection is lost, offer a way to manually cancel the search (or always?). Or just hide the indicator and disable the ability to start searching in a new location -- maybe that's also a good place to put a notice that there's no connectivity ("Can't scan for quests when offline").

They sound good.

The new download indicator is certainly a lot clearer, but it's also a lot more obtrusive if you're trying to map while it's present.

@westnordost
Copy link
Member

What is the current timeout? I was still seeing it stuck onscreen after 10s of minutes wandering around offline.

180s, that's the server-side timeout of overpass.

@westnordost westnordost removed bug feedback required more info is needed, issue will be likely closed if it is not provided labels May 10, 2020
@westnordost
Copy link
Member

I am not sure about the suggestions so far. I think I will leave the ticket open for some time. It is not a bug at least, but maybe enhancable behavior.

@peternewman
Copy link
Collaborator Author

What is the current timeout? I was still seeing it stuck onscreen after 10s of minutes wandering around offline.

180s, that's the server-side timeout of overpass.

I've just started a search, switched away from SC, turned off my WiFi (mobile data was already off) and waited 5 minutes and the icon is still stuck onscreen. Pressing the menu and Scan for quests still says "You are offline".

Turning the WiFi back on and leaving it for another 5 minutes that search still doesn't complete.

At this point, pressing Scan for quests offers the stop and scan here or continue prompt. Pressing continue and waiting five minutes still produces no progress.

Then opting for scan here instead finally completes this scan and moves onto the next one.

So something isn't working right with the timeouts, for me at least, I'd suggest the particular behaviour I'm seeing is a bug, especially as it doesn't resume properly when back on the network.

@westnordost
Copy link
Member

Okay, hm

@westnordost
Copy link
Member

Tried it on a different device and was able to reproduce it there. Found a bug there: If an error occurs during download and it is cancelled (i.e. connection lost is an error), the service wouldn't set the "is downloading" boolean flag back to false.

@peternewman
Copy link
Collaborator Author

peternewman commented Jan 24, 2021

I'm taking the liberty of re-opening this issue @westnordost as it seems to be happening again at least once. I don't know if it's a regression of your existing fix or some new issue. I had to force stop the app this time to get it to stop searching.

All I can see from:
9b61076
to:
https://github.com/streetcomplete/StreetComplete/blob/49d19dd13bac1daff69d9797f6dc28f9a2c06f99/app/src/main/java/de/westnordost/streetcomplete/data/download/DownloadService.kt

Is that is isDownloading is set to true before the try/catch, but I assume it's something outside of that code causing the issue.

@westnordost
Copy link
Member

The uploading/downloading and all that has been completely reavamped in the dev version, i.e. all the code at that point changed. So I will close this again when that version is out, claiming it has been fixed even though I didn't actually look into the issue.

@peternewman
Copy link
Collaborator Author

Thanks @westnordost . I'll keep an eye out when the new release appears.

@peternewman
Copy link
Collaborator Author

Hi @westnordost ,

I've had this happen again with v32.0-alpha1. I think I'd waited three minutes for it to timeout. At least once it was on a captive portal for WiFi, which is obviously a particularly challenging thing to deal with. I'll try and double-check the timeout thing for certain soon.

@westnordost
Copy link
Member

We had some instances in the past where it indeed took more than 3 minutes to download+persist+create quests+persist quests - in particularly dense areas for example. Are you sure that the download really finished already and it was a UI issue?
(Try to download at the same location and reasonably zoomed out again - how long does it take?)

@peternewman
Copy link
Collaborator Author

But I'm talking about when it's offline/captive portal so no proper network connection, at which point shouldn't the timeout for a partial download always be hit, or worst case a little more time on top to persist/create/persist for the data it did manage to download?

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

No branches or pull requests

3 participants