-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix updating a location's parent via UI #1217
Comments
…le users when location parent is updated
Lets add integration test for this with valid scenarios. |
…eset sync records for applicable users when location parent is updated
got this error errors-edit_location_edit_rwb_2 (1).csv
|
|
Tried creating a minimal reproducible example but did not hit the above error after changing parent multiple times. Scenario constructed: Registered subjects in both Village1 and Village2. Changed parent of State1 and State2 multiple times to Country1 and Country2 and verified reset sync was displayed and no error during sync for both users. Moving this back to QA ready since sync behaviour was not changed as part of this card and unable to reproduce this error. |
Need:
Currently when a parent of a location is updated via UI it is not handled correctly. The subjects of the updated locations are not marked for migration and hence could lead to association error. Could be one of the reasons why some association errors for which root cause could not be determined has happened.
Technical analysis:
virtual_catchment_address_mapping_table
orcatchment_address_mapping
. On some analysis here, catchment_address_mapping seems to be faster. The decision is upto the developer.ResetSyncService.java -> recordCatchmentChange() in avni_server
AC:
Identify the users to be marked for complete reset sync using the below strategy: Say, A's parent is updated to B from C
if any of A or A's children have subjects registered in it then,
- check for users with catchments which have any of (B's location, any of the B's parents' locations, C, any of C's parent locations)
- mark the users for complete reset sync
else if neither of A or A's children have subjects registered then,
- no need to mark any of the users for reset sync
Out of scope:
Identifying more smart strategies to minimise the impact of reset sync.
Old: ignore
Need:
We 've not handled updating of location parent correctly. The subjects of the updated locations are not marked for migration and hence could lead to association error. Could be one of the reasons why some association errors for which root cause could not be determined has happened. This can be achieved by creating the locations in destination + deleting of the old locations. So no need to support this, since technically supporting this as well is not easy.
AC:
Disable updating location's parent for already created locations.
Old: ignore
Steps to reproduce:
env: staging org: RWB_Niti
current status of locations: Akola is under Maharashtra, and it contains Patur Taluka
edit_location_edit_rwb_2.csv
AC:
Suggestions:
Inputs:
Code reference:
https://github.com/avniproject/avni-server/blob/290e434960dd0e89a80f9d13859d1efdc0219ff8/avni-server-api/src/main/java/org/avni/server/importer/batch/csv/writer/LocationWriter.java#L151
Reference source card:
https://app.zenhub.com/workspaces/avni-product-deprecated-635b73bded85e50018871ae6/issues/gh/avniproject/avni-server/380
Analysis notes:
Not allowed because then need to update the lineage of all parents and then need to do reset sync for subjects of source and destination addresses. So as an alternative, new location can be created in the destination and /subjectMigrationBulk can be called via API or via code if we are gonna support. We can update the location parent from UI as well. Here as well we have not handled migration of subjects but we have done
updateDescendantLocationLineage
. So the question is should we support? We might get association errors if not handled.The text was updated successfully, but these errors were encountered: