remulasce / metroapp

Realtime arrival notification utility for LA Metro
2 stars 0 forks source link

Arrivals are only invalidated by their internal countdown timer #205

Open remulasce opened 9 years ago

remulasce commented 9 years ago

Once an Arrival is made, it can be updated to match the NexTrip server when server updates are propagated.

However, if NexTrip doesn't provide a matching Arrival, the local Arrival is kept and just keeps counting down.

That means NexTrip can't come back and tell us the bus has come and gone already ahead of schedule. Once a bus arrives, NexTrip stops reporting it. But when we get a missing report, we just keep ticking down the last prediction.

What should happen is that if an update comes in that is missing a bus we're tracking, we should set that bus arrival as "arrived" and get rid of it in a few seconds.

We need to alert the user when this happens, though. I don't want us to take the blame for a disappearing arrival.

nighelles commented 9 years ago

Fixed, sorta. New code will show the bus as arriving for a few sec rather than just disappearing it. Not hugely better, but doesn't just disappear.

remulasce commented 9 years ago

This doesn't appear to happen on Android.

You should check that relevant code was merged correctly. It otherwise may be just my platform-specific ui code dropping it.

nighelles commented 9 years ago

Hmm, I think the code that was the fix for this got magicked away by git. I'll try I fix it again.

nighelles commented 9 years ago

I think it makes more sense to iterate over the current arrivals, applying updates and doing logic, and then add any updates that aren't already accounted for. Otherwise you need like two separate buffers