Fix null Tile#buffers error - #1987
Conversation
|
As a replacement for |
|
How long before this usually deployed? Also, is there a nice way to grab these latest changes in case the roll out is slow? |
|
Test? |
|
Sorry, I got a local copy running. Trying it out now. :) |
|
@jfirebaugh I'm still scratching my head on coming up with a good regression test here.
|
|
That's a good answer. :) I just wanted to make sure it was on your mind. If this was caused by the fix to #1933, then we had two serious regressions in as many releases, and they were related. That to me is an indication that we should invest some time into figuring out how to get this code under test. |
There was a problem hiding this comment.
Object.keys({}) is still truthy. You'll need to check for length probably.
There was a problem hiding this comment.
Thank you. Pushing a fix shortly.
Side note: the !Object.keys(this.buffers) branch is total cargo cult programming. It is never triggered AFIK but I'm preserving it as a refactor of hasLayerData. Maybe that's a mistake and it should be removed altogether.
There was a problem hiding this comment.
I understand the problem a little better now. Tile#buffers is null because of https://github.com/mapbox/mapbox-gl-js/blob/null-buffers-1983/js/source/tile.js#L57 and https://github.com/mapbox/mapbox-gl-js/blob/null-buffers-1983/js/source/tile.js#L109. I'm going to remove !Object.keys(this.buffers).length entirely.
96fdec1 to
a897786
Compare
Agreed. This has been really bad. I think the long term solution should include
|
a897786 to
c8123d4
Compare
|
@jfirebaugh @mourner after a little more digging, I found a better solution to the problem, 👀? fixes #1991 now (unfortunately this approach doesn't make the PR any more testable) |
c8123d4 to
70f0677
Compare
|
merged in 70f0677 |
fixes #1983
I think this error is triggered every time
setDatais called on a GeoJSON source used by alineerror.I was able to replicate the error by instantiating
mapbox-gl-drawon the latestmapbox-gl-js.