AmericanWhitewater / aw-ios

American Whitewater's iOS app
5 stars 2 forks source link

Flows on App Not Updating #280

Closed AWKevin closed 1 year ago

AWKevin commented 1 year ago

Flows on the iOS App are not updating, and with rising flows, that is dangerous. @ngottlieb can you look into this? It’s not good. Here is the river on which I noticed this last week:

IMG_4080 IMG_4079 IMG_4082 IMG_4078

ngottlieb commented 1 year ago

@AWKevin can you confirm what I seemed to glean from the Slack conversation here -- that the issue is that the app just isn't refreshing the data? (meaning, does not refresh automatically when you open it, does not indicate refresh is needed, and only allows manual refresh on the reach list, not on reach details)

AWKevin commented 1 year ago

Yes. If you go to the app, the flows are not updated. You have to click through to the AW site to see the real flows.

The issue is about refreshing flow information. When you open the app it loads flows. Those are old. Then you have to slowly pull the screen down and release it just right to make it refresh. If you don't do that or do it wrong the old flows remain. Once you go to a river page refresh is not an option. I believe that the flows should be refreshed every time the app is opened or distance/region is changed. I also think there should be a better Refresh UI if it is not going to auto-refresh fairly often.

@Gregliest said he could maybe look at it next week, but I think it merits a quicker look given the sandbag potential.

ngottlieb commented 1 year ago

OK, I'm looking at the iOS code and starting to understand what's going on here. What I'm hearing from you is:

I'd also like to suggest that the timing you see on the reach detail view -- "May 14, 2023 8:04:39 PM" in your screenshot -- should reflect the time of the gauge reading, not just the timestamp of the last time the app was updated.

There's obviously a lot more that could be done here but these two things seems like the simplest and quickest path forward? @Gregliest input welcome...this is the first time I've attempted to work on an iOS app, let alone this particular one.

AWKevin commented 1 year ago

I assume based on what I am seeing that both of your ideas would largely or entirely resolve the issue. Ensure refresh + timestamp the data. Note that right now the date stamp is wrong. It will say today's date but without updating the flow information. I see you noticed that too, and to me it needs to reflect the flow data update.

Note the information below was not updated, even though the date stamp indicated that it was. IMG_4130

riversandcreeks commented 1 year ago

Yes to fixing this! I have seen these issues and encountered many boaters confused by our inconsistent flow data.

ngottlieb commented 1 year ago

@AWKevin @riversandcreeks I have at least an initial fix for this that I think resolves the urgent aspects of the problem. Here's what I've done (pending code review, hopefully @Gregliest can take a quick look at it this week):

Does that solve this problem at least for the purposes of this urgent bug fix, or is there more to it?

Notably, I have not adjusted the app to automatically reload anything at any time, though we could go that direction if desired.

riversandcreeks commented 1 year ago

This makes sense to me as the first thing to try.

AWKevin commented 1 year ago

Yes, let's do this asap. Thanks nick!

Gregliest commented 1 year ago

Thanks for tackling this @ngottlieb. Your change looks good for the reach detail. However, I think there's a related bug on the main run list page, where sometimes the update timestamp is wrong. I'm looking into it now.

AWKevin commented 1 year ago

Have the apps been updated with this fix?

AWKevin commented 1 year ago

This does work, and is better, but is slow. Maybe a minute to update a river page. From a user standpoint I don't expect things to take that long. I just expect flows to be updated when I open the app. I'll close this and maybe we can improve it over time.