cityofaustin / atd-data-tech

Austin Transportation Data & Technology Services
17 stars 2 forks source link

Show error message when a component create or update mutation fails #18590

Open mddilley opened 3 months ago

mddilley commented 3 months ago

We received a report where component line edits failed to save. This happened on project 1989 and 697, and I included the steps to replicate from the report below.

I ran into a weird thing this morning that has never been an issue. I tried editing mapping and it wouldn't let me save. The edit was trying to save was deleting a hand drawn line and selecting one of the street network lines. The save button was unresponsive.

I am able to edit tabular data. I was able to edit a point. I was able to select a different link and safe. So it seems like there is something wrong with this link of the trail over the UP tracks. I was able to just adjust the custom mapping and avoid using this segment. Not a high priority issue upon further exploration just a strange dead / unselectable link in Moped

To replicate locally:

  1. Go to project 1989
  2. Use the map edit mode on Trail - Bridge with description "over railroad tracks" (component 2880)
  3. Select the drawn line and then delete it. Note that there is a selectable street segment just below the drawn line. The save button should be disabled since no line is selected.
  4. Select the street segment that you noted in the last step, and the save button will be enabled.
  5. Click save and see that it fails. Check the console for error message below and see the network request for the GraphQL error that is occurring.

Screenshots submitted image

image (3)

Error messages

Screenshot 2024-08-12 at 11 03 50 AM Screenshot 2024-08-12 at 11 04 18 AM
mddilley commented 2 months ago

Looping back here to note that this issue is happening because the CTN street segments feature service is returning a MultiLinestring geometry instead of a Linestring. The GraphQL error is happening because the app doesn't handle this unexpected type. The geometry can be fetched from the feature service with this query.

I shared this with Andrew, David, Frank, and Charlie yesterday and learned some details:

mddilley commented 2 months ago

Setting this as blocked by another issue concerning surfacing map errors. This is another one where we don't show any user feedback when an action fails unexpectedly. We should use the same error pattern here.