mapbox-gl-js version: 0.49.0
simple hidden a raster layer map.setLayoutProperty('layerID', 'visibility', 'none') will duplicate http request`
add a raster layer with google map source.and clear network console

hidden raster layer by map.setLayoutProperty('layerID', 'visibility', 'none'),and you will find it trigger duplicate http

I think visibility should not trigger source reload. Could somebody identify which ones layout property should trigger sourceCache.reload like paint property.

visibility is a layout property and source reloads are generally necessary for layout property changes. However, the case you describe is a little bit special because by setting the visibility to none, you're removing the last layer that uses the source. The code in Style#update triggers a reload of the source first, and then after triggering the reload it does the calculation to determine which sources are used, at which point it clears out the tile set for the hidden source. Although the tile set is cleared out almost immediately after the reload is triggered, the first messages get sent to the workers and they trigger the network activity you see (although it should be pretty cheap since the tiles are already loaded and they haven't expired).
I found that the branch of 0.20.0 version of the same code, the request is not made, the new code on request
This was likely fixed by #7459. I'll reopen if it's not the case.
Hey, we have the same issue with the latest version (1.1.0), I see it was mentioned this was fixed by #7459, but #7459 is actually this issue...
Oh, I meant #8005. Let's reopen and check again then.
Most helpful comment
Hey, we have the same issue with the latest version (1.1.0), I see it was mentioned this was fixed by #7459, but #7459 is actually this issue...