DigitalCommons / land-explorer-front-end

React app for the Land Explorer front end
http://landexplorer.cc
GNU Affero General Public License v3.0
1 stars 0 forks source link

featureId error when editing a polygon #247

Open ms0ur1s opened 1 year ago

ms0ur1s commented 1 year ago

I’ve encountered this error locally and on staging. It is not present on live. My first thought was that I’d introduced it while working on my current issue, #230, but found it intermittently appearing on staging. Still attempting to map out the steps to recreate. When thrown this error prevents the selected polygon from being edited.

The account I used for the tests below is virgin, has never been used locally and is only being used on staging via incognito.

Testing process

  1. Created Map 1, added a polygon an edited directly after creation, no errors encountered.
  2. Closed incognito (by accident without logging out), logged back in, selected this Map 1, received the featureId error - preventing the polygon from being edited.
  3. Created a second polygon on Map 1.
  4. Managed to edit again immediately, no errors.
  5. Logged out and in again, and managed to edit the second polygon, no problem.
  6. I added a second polygon on test map, residual polygons from the previous map remained, but gone after I switched maps.*
  7. Edited this polygon, no problems.
  8. Switched from Map 2 to Map 1 attempted to edit the first polygon and received error. Same result with both polygons.
  9. Managed to switch back to the Map 2 and edit the polygon, error free.
  10. Again same result for both polygons on Map 1 after switching - featureId error.
  11. Again, polygon on Map 2 was editable after switching between maps.
  12. Created second polygon on Map 2.
  13. Immediately edited polygon
  14. After creating second polygon on Map 2 and switching between maps, and switching to Map 1, any attempt to edit a polygon on Map 1 still throws and error,
  15. Polygon 2 on Map 2 still editable.
  16. Created a third map, although both polygons from Map 2 are visible. Neither is selectable.
  17. Polygon created on Map 3 and immediately edited.
  18. After switching to Map 2 its polygons are still editable
  19. However the polygon from Map 3 is now also visible, and when I click on the map deselecting all polygons, then click edit in the left hand tray, all the polygons are given a blue outline, and I can edit the polygon from Map 3.
  20. The native polygon on Map 3 three now errors when I attempt to edit it.
  21. Switching back to Map 2, Map3’s polygon has disappeared.
  22. Yet, Map 2's polygons still appear on Map 3.

featureId errors

Private Zenhub Image

Private Zenhub Image

Private Zenhub Image

Polygon from third map visible on Map 2

Private Zenhub Image

Polygon from third map made selectable on Map 2

map 3 polygon selectable on map 2

Polygon from third map being edited on Map 2

Private Zenhub Image

ms0ur1s commented 1 year ago

Tested on a previous branch #228, following the same process with similar results.

I wanted to recreate the previous conditions as faithfully as possible, so I closed the browser window after creating the first map and polygons, as before. I will perform another test without this step and perhaps repeat that using a regular browser window (not incognito).

test_on_previous_branch_1

test_on_previous_branch_2

test_on_previous_branch_3

ms0ur1s commented 1 year ago

Performed a further test without closing the browser mid session. On this occasion I was able to:

Conclusion If it wasn't obvious before, there seems a clear correlation between the bleed through of polygons between maps and the erroring and inability to edit polygons native to maps suffering from bleed through. It is also possible that there is a data leak between maps even when no polygons exist, which may or may not cause polygons to error when attempting to edit.

Proposed Resolution Ensure previous map data is cleared when switching between maps.

Map 1's polygons visible on Map 2

map_1_polygon_visible_on_map_2

Map 1's polygons visible on Map 3

map_2_polygon2_visible_on_map_3

Map 1's polygons no longer visible on Map 2

map_1_polygon_no longer_visible_on_map_2

ms0ur1s commented 1 year ago

That's what I thought, so I tried it on the #228 branch where I fixed this problem, but I received the same results as above. #228 relates more to data leaking between sessions after logging out and between different accounts using the same browser, whereas the above relates to data leaking between maps within the same account, regardless of session.

So similar but different. And it feels like it requires a similar fix but in different context.

lin-d-hop commented 1 year ago

Great! Nice find :)