go-frontend icon indicating copy to clipboard operation
go-frontend copied to clipboard

[PROD] The id for admin2 from vectortile layers does not match.

Open tnagorra opened this issue 1 year ago • 18 comments

Issue

The id for admin2 from vectortile layers does not match the id for admin2 from the server database.

Steps to reproduce

  • Go to 3W Project Form
  • Enter Country, Admin1 and Admin 2
  • Submit the form.
  • The form cannot be submitted.

Expected behaviour

User should be able to save the form.

Impact

This should affect all the users trying to submit 3W Project Form with admin2 information.

Is there a workaround?

There are not workarounds.

tnagorra avatar Sep 27 '23 06:09 tnagorra

cc @geohacker - I think if you, me, @szabozoltan69 and @tnagorra look at this together, you'll be able to guide on the best solution here.

batpad avatar Sep 27 '23 15:09 batpad

@szabozoltan69 @tnagorra possible for you to give me one example admin2 so i can verify on the tiles?

geohacker avatar Sep 28 '23 08:09 geohacker

... one example admin2 so i can verify on the tiles?

Here, on staging there are some examples: https://goadmin-stage.ifrc.org/en/admin/api/admin2/ (Or the similar on prod, without "-stage".)

E.g. https://goadmin-stage.ifrc.org/en/admin/api/admin2/22 is Syrian Arab Republic - Homs - Ar-Rastan SY0404 This ID is identical to the Prod's one (and has the same name).

szabozoltan69 avatar Sep 28 '23 08:09 szabozoltan69

Thank you @szabozoltan69. So in the tiles we have the following for the Homs - Ar-Rastan example you shared above. The thing that's missing here is the code. Is that what @tnagorra is referring to?

image

geohacker avatar Sep 28 '23 09:09 geohacker

@szabozoltan69 The ids on production and stating is the same right now because we are using the clone of production database on the staging as well (for the rewrite)

@geohacker The id for Syria > Homs > Ar-Rastan is 3792, which is the only unique identifer for that admin2 If you look at the the id for Syria > Homs > Ar-Rastan in the GO backend, the id is 22

Also, there are only 1035 admin2 rows in the Go backend.

The id coming from the vector tiles did match the id from the backend on the ACTUAL staging database.

tnagorra avatar Sep 28 '23 11:09 tnagorra

The ids on production and staging is the same right now

Yes. The most of the admin2 work happened on the old (already not used) staging database.

A question: is it good to do changes in develop, or would it be better in web-rewrite? (The failure of snap tests make this question interesting: should we follow both snapshots, in develop with old structures... and at develop<-web-rewrite merge time with conflicts?)

szabozoltan69 avatar Sep 28 '23 11:09 szabozoltan69

@szabozoltan69 This should not be a major change on the frontend so we can either do the change on go-frontend (develop) or go-web-app.

tnagorra avatar Sep 29 '23 06:09 tnagorra

@tnagorra It's recently a backend change of geohacker, so (at least the backend part) it would be fine to do in web-rewrite to be able to test it on Staging.

szabozoltan69 avatar Sep 29 '23 06:09 szabozoltan69

@szabozoltan69 @geohacker Can you fill me in the details of how the admin1 and admin2 layers are kept in sync with the GO database?

tnagorra avatar Sep 29 '23 06:09 tnagorra

There is a backend job (see the above change) which sends data from GO database to MapBox and creates layers there. From that data sending an id (code) was missing, that causes the trouble. We have to rerun this repared job to fix the missing "code" id. At first on Staging, then, if works, on Prod.

szabozoltan69 avatar Sep 29 '23 06:09 szabozoltan69

Thanks @szabozoltan69 for the clarification. Please let me know once the fix has been deployed to staging so that I can also confirm the changes.

tnagorra avatar Sep 29 '23 09:09 tnagorra

The fix is deployed to Staging, but we still need to run the job to create new entities in MapBox. For which shape files should we run this admin2 importer, @davidmuchatiza ?

szabozoltan69 avatar Sep 29 '23 11:09 szabozoltan69

This issue could be tested on Staging, it should be fixed. All the admin2 areas were renewed via the new map-tiling job. @tovari @tnagorra @geohacker (I am not 100% sure if we have any tasks left after running the update-mapbox-tilesets jobs.)

szabozoltan69 avatar Oct 10 '23 07:10 szabozoltan69

Thank you @szabozoltan69. I can't think of anything else!

geohacker avatar Oct 10 '23 09:10 geohacker

@szabozoltan69 Looks like the issue has been fixed on the staging server.

Just created a 3W Project with admin 2 on Afghanistan. https://go-stage.ifrc.org/three-w/projects/2611

I don't know where the admin 2 is visible except on the edit page :)

tnagorra avatar Oct 10 '23 09:10 tnagorra

Dear @tnagorra, you're right that the Admin2-s are visible only on edit page. :-( Anyway, I tried to add Admin2-s to https://go-stage.ifrc.org/three-w/projects/2612/edit on frontend, but I couldn't. (From Admin page, of course, yes.) (There are Admin2-s to that country, e.g. https://goadmin-stage.ifrc.org/en/admin/api/admin2/18920 )

szabozoltan69 avatar Oct 12 '23 10:10 szabozoltan69

@szabozoltan69 @tnagorra is there still work required under this issue or can it be closed? Thanks

nanometrenat avatar Mar 18 '24 20:03 nanometrenat

(bump)

nanometrenat avatar Apr 11 '24 09:04 nanometrenat