GeoNode / QGISGeoNodePlugin

A QGIS plugin that provides integration with GeoNode
https://geonode.org/QGISGeoNodePlugin/
GNU General Public License v3.0
12 stars 16 forks source link

Multiple replies for the same request breaks requests handling #275

Closed giohappy closed 3 weeks ago

giohappy commented 4 weeks ago

We have noticed that sometimes QGIS (Qt) returns multiple replies for the same request, but only the first one contains valid content. This was observed, for example, when the QGIS network cache is forcibly emptied (from the UI).

This behaviour doesn't depend on the plugin. It's also observed for other network providers (e.g. WMS) and without the GeoNode plugin loaded.

A workaround is to only parse the first reply for the same request, and disregard the next ones.

Gpetrak commented 3 weeks ago

@giohappy we have to modify accordingly the LayerUploaderTask which is a subclass of network.NetworkRequestTask because during the layer upload, the plugin raises an error because of the following line: https://github.com/GeoNode/QGISGeoNodePlugin/blob/main/src/qgis_geonode/apiclient/geonode_v3.py#L639

giohappy commented 3 weeks ago

@Gpetrak this could probably be refactored to avoid repeating the pattern?

From a quick look it seems most part of that method is the same as the base class.

Gpetrak commented 3 weeks ago

@giohappy yes good point. We can include this refactoring in the issue related with the tasks consistency: https://github.com/GeoNode/QGISGeoNodePlugin/issues/280 However, at the moment we could quickly fix it in order to include that fix to the PR of this issue.

giohappy commented 3 weeks ago

yes, go ahead @Gpetrak