Operative13 / CS480

1 stars 3 forks source link

Network request failed after 10 mins elapsed after game creation #29

Open jtara1 opened 6 years ago

jtara1 commented 6 years ago
17:14:27: Network request failed
- node_modules/react-native/node_modules/whatwg-fetch/fetch.js:441:29 in onerror
- node_modules/event-target-shim/lib/event-target.js:172:43 in dispatchEvent
- ... 9 more stack frames from framework internals

When I dismiss the error on my phone, it shows the timer stuck at 00 01 (1 sec). I'm still moving around and I'd assume I can still capture a zone at that point.

I'm going to add an onError callback to Game#listenForRegionChange in-case that's the problem.

jtara1 commented 6 years ago

It has nothing to do with the timer. It seems to occur between 5-20 mins after the game screen is running, and is something to do with whatwg-fetch which provides the fetch function in the sdk. There was another error printed in console that said null doesn't have property geolocations which means there's something in GameScreen that uses the sdk that needs to at least do a truthy or null check. screenshot_2018-05-06-13-46-55

fixed with 4933e01fcbfb6b4a6447eee515ea7f2203993d13 but there's a chance this is just a bandaid and the problem is deeper or different

jtara1 commented 6 years ago

It gave the same error (for a different reason?) after 21 mins of running.

15:31:07: Network request failed
- node_modules/react-native/node_modules/whatwg-fetch/fetch.js:441:29 in onerror
- node_modules/event-target-shim/lib/event-target.js:172:43 in dispatchEvent
- ... 9 more stack frames from framework internals

I ran the app via expo on Win10 for 30 mins and it threw no error. That might've been a coincidence though.

jtara1 commented 6 years ago

this isn't actually a fatal error. at least, nothing terrible seemed to occur

error messages like these are now suppressed for a smoother demo

David-Hughes3 commented 6 years ago

There is no plan to currently fix this, but instead we will just suppress warning messages for the demo.

jtara1 commented 6 years ago

I didn't realize, using console.error in a react native app will actually show the user this scary red screen. Guess it's better design to an alert or an in-app notification pop-up to tell the user there could be an error.

I also did some fixes related to the websocket on the backend which may have helped this