frksteenhoff / ClimApp

Codebase for prototype and final version of the smartphone application ClimApp, a project under the European Research Area for Climate Services. The application is available for iOS and Android in App Stroe and Google Play respectively.
https://www.lth.se/climapp/
4 stars 2 forks source link

in app Troubleshoot feedback to user #85

Closed BorisKingma closed 5 years ago

BorisKingma commented 5 years ago

We need to inform the user what is causing a problem in obtaining weather data:

frksteenhoff commented 5 years ago

Possibly I think it should be as a toast rather than written within the panel.

BorisKingma commented 5 years ago

sounds intuitive, and also easy to implement. onFail listeners are easily implemented for geolocation and weather data.

good one to fix for next weeks update ;-)

frksteenhoff commented 5 years ago

There seems to be something completely off.. We are checking if the currentindex is -1 and the absolute time difference Math.abs(dif) is < 2 but debugging it now, the value of dif is 91. This seems to be an unexpectedly large value?

frksteenhoff commented 5 years ago

I have the exact same problem as Nikola. Will investigate further tomorrow, might need some explanation of the exact logic to understand the expected output values.

BorisKingma commented 5 years ago

that part is where it goes through a time sorted array

the intended behavior there is:

  1. find timeblock associated with NOW in local timezone

currentindex==-1 if not yet found

abs diff <2 means that hour difference is less than 2.

no priority issue. it solves itself in 1 hour = when the weatherreport is in right timeslot.

this occurs when forecast is too far from now, no timepoint 'around now' available.

frksteenhoff commented 5 years ago

Weather information is received, however the logic does not allow for an update of the dashboard. I cannot seem to find the error, but something in the logic does not work as expected.

frksteenhoff commented 5 years ago

It seems to be the UTC that is causing the trouble. I am not sure exactly what you want to acheive with the different dates, but the dates fetched are several days from today. I don't think I will be able to solve this problem myself.

image

BorisKingma commented 5 years ago

1st part: the database holds records for a given lat/lon, and with the UTC parameter we tell the database which datetime it should fetch. Apparently, there is a translation error of UTC dates between the platforms, but only for specific devices: otherwise all devices would have the problem. It could be a localisation issue we should enwrap.

this relates to the UTC trouble I was talking about on whatsapp.

we have this proces: JS - > UTC date conversion -> to string PHP -> receive UTC field as string MySQL -> interpret UTC string and compare to UTC dates in database - return records centered around input UTC

BorisKingma commented 5 years ago

Okay, I solved the issue....

the sensationmapss API had a bug.

abstract explanation:

function functionWithBug( $input1, $input2, $inputActuallyBelongingToFunctionX ){ //$inputActuallyBelongingToFunctionX was copied by mistake into input parameter line }

function functionX( $input1, $input2, $inputActuallyBelongingToFunctionX ){ ... if( $criterion ){ return functionWithBug( $input1, $input2 ); // and this ofcourse fails!! because not enough input parameters } }

---stupid

Regards, Boris

frksteenhoff commented 5 years ago

Ahh. I see. Nice that you got it fixed 😺 Finding that all the data was actually existing in the app and being sent correctly, but still resulting in errors was kind of frustrating. I have some minor changes that I will add to your pull request today.