NYCPlanning / labs-regional-viz

An interactive mapping experience that highlights regional planning data and trends.
Other
6 stars 1 forks source link

Rapid clicking "Next" then "Previous" throws errors, breaks app #64

Open allthesignals opened 6 years ago

allthesignals commented 6 years ago

Certain race conditions with mapbox gl's map instance being loaded and the framework attempting to update attributes lends itself to some unpredictable error states with the app...

In this case, if a user rapidly clicks "next" several times, then clicks "previous", there will be issues about missing sources.

allthesignals commented 6 years ago

The test passes, but you can see the errors in the console log:

screen shot 2018-03-01 at 11 24 55 am

See branch for test: https://github.com/NYCPlanning/labs-regional-viz/tree/feature/failing-test-for-race-conditions

andycochran commented 6 years ago

I can't replicate this manually. Is the test clicking faster than humanly possible?

allthesignals commented 6 years ago

Yeah, you have to hold your mouse where the next button will be, then refresh. I know it's a reach but having race conditions in the app is bad because things may break unexpectedly and we won't know why!

daragoldberg commented 6 years ago

@allthesignals did we address this? can we close?