mozilla-mobile / prox

[INACTIVE] A search and discovery app for the "here & now". We're experimenting with ideas on mobile that can better surface content from the open web.
https://wiki.mozilla.org/New_Mobile_Experience
Mozilla Public License 2.0
22 stars 12 forks source link

Device hangs when retrieving many places #543

Closed mcomella closed 7 years ago

mcomella commented 7 years ago

I think this may be related to waiting for Promise.allFilled for travel times.

mcomella commented 7 years ago

I am unable to reproduce now (both on my device and in the simulator). Thoughts:

mcomella commented 7 years ago

Repro notes:

Related?

2017-03-03 15:50:48.342973 Prox Mock Location[442:27571] [LogMessageLogging] 74.1 Unable to retrieve CarrierName. CTError: domain-2, code-5, errStr:((os/kern) failure)

I see this even when it successfully pulls places, however.

Unrelated?

mcomella commented 7 years ago

via MKDirections.calculateETA:

Your completion handler is executed on your app’s main thread.

I wonder if we're hitting a race! Maybe we all hit it at the same time because the server is taking longer to respond than usual.

mcomella commented 7 years ago

I saw this occur on Maria's iPhone 6 but not in my iPhone 7+ in the same moment – maybe this is affected by CPU speed (which is why we haven't been able to reproduce frequently on laptops).

mcomella commented 7 years ago

A few more repro notes from Maria: can repro more frequently on cell network. Happens more earlier in the day

liuche commented 7 years ago

Saw this once in the simulator, but the logs don't seem to be more helpful than showing the error for geo/direction throttle.

screenshot 2017-03-07 13 51 29
thebnich commented 7 years ago

I found that MKDirections.calculateETA simply isn't executing its callback at all, which seems like an iOS bug. I added a delayed dispatch on the main thread to see if maybe the main thread is deadlocked and we're seeing this as a side effect, but the dispatched callback executes just fine after the app freezes.

Was originally going to sort by raw distance and update the walking distance only as the cards are shown, but that would slightly reorder the cards, which is risky given the closeness to Chicago. Adding a timeout is probably the safest bet for now since it doesn't change the experience.