Kits not showing on the map - broken filters
Closed this issue · 7 comments
@oscgonfer is this still an issue?
I think this is the same issue since the other day, some kind of caching?
Now I can see these devices.
Another example, I can also see devices 10.000 and 10.001, they are the ones in La Marina De Port:
Just checked the latest kits and they show while browsing. I don't know how long they take to appear though, it might be something to check?
Looking at the developer console, I can see the id
of the kit (10236) on both pages inside the world_map object.
But it is not represented on the map.
Notice also that the nr of the request is 1225 on one page, but 1226 on the other.
Update:
Here we have a kit with id 10015
number 651: (on /kits/:id page)
But here it is missing: (on /kits/ page)
Which means that /kits/:id
and /kits/
are not getting the same world_map
?
Any news from this?
Can we discard this is an issue between world_map
and fresh_world_map
? In other words, this looks like a front-end issue only, right?
We are receiving around 2-3 user complains per week, that's why I'm writing a follow-up
I am trying to narrow it down, and I think we can discard that the fresh_world_map
is the reason. It is not called on either /kits/
or /kits/:id
, so looks like we are not using it in this case.
The /kits/
endpoint already has the missing kits info in the data
object on map initialize.
smartcitizen-web/src/app/components/map/map.controller.js
Lines 162 to 166 in cdc9b3f
When I console.log(data)
(locally in line 167), I can see the missing kits, but they are not shown on the map when we visit /kits/
only on /kits/:id
In my newest example, multiple kits were missing in the same area, and all of them appeared on the /kits/:id
page.
So it is not just adding the missing kit to the list, because all missing kits are shown.
I have narrowed it down to this function:
smartcitizen-web/src/app/components/map/map.controller.js
Lines 306 to 316 in cdc9b3f
The _.every
will STOP when 1 of multiple labels does not exist, on the first false
one.
This means that the device would need to have ALL labels, instead of just any label to be allowed.
A device with the label 'new' will therefore not be visible
This is why one shows the new kits, and the other does not.
If the /:id parameter is present, it will not call updateMarkers()
smartcitizen-web/src/app/components/map/map.controller.js
Lines 184 to 189 in cdc9b3f
When you visit /:id of the kit, and you see it, the kit will go away when you apply filters.
In the following example:
The second one will be added to the map, the first one not.
Also, this line:
vm.selectedFilters = ['indoor', 'outdoor', 'online', 'offline'];
Should it also include 'new' ?