ternandsparrow / wild-orchid-watch-pwa

Progressive Web App for the Wild Orchid Watch citizen science project
https://app.wildorchidwatch.org
4 stars 4 forks source link

Can't find obs page on refresh #100

Closed sbbu closed 2 years ago

sbbu commented 2 years ago

Env Commit fb482c0 Chrome 102 on Linux

Steps

  1. launch app and login
  2. open the details page for an observation (tap on it)
  3. refresh the page

Expected: The page refreshes and loads normally. This currently works on https://beta.app.wildorchidwatch.org/

Actual: The observation cannot be found and the page displays a 'not found' error to the user. image image

tomsaleeba commented 2 years ago

This should be fixed by line 233 in router.js that I just merged. The problem, as hinted by the warning, is that it can't find the ID. This is because I used === so the string type of the param won't match the number type in the record. The fix was the cast the string to a number.

The error after that is a red herring. It comes from OnsenUI and it happens everytime you directly load the ObsDetail page. Just go the page and reload and you'll see if everytime. I did look into it ages ago, but couldn't fix it then, and it doesn't break anything so :see_no_evil: .

Can you re-test and see if my PR fixes this bug? If it does, the bug can be closed :muscle:

sbbu commented 2 years ago

I've tested and verified that the bug is fixed 👍