Skip to content
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

cannot create catchment/user group with same name even if the first one is voided #858

Closed
Tracked by #1557
nupoorkhandelwal opened this issue Dec 27, 2022 · 8 comments
Assignees

Comments

@nupoorkhandelwal
Copy link
Contributor

nupoorkhandelwal commented Dec 27, 2022

Issues:

  1. It seems when checking duplicates(when creating catchment) we are also including voided ones. That should not be the case. It's confusing to the admin user as it says the catchment exists but admin does not see it anywhere.
    https://github.com/avniproject/avni-webapp/assets/10369963/dee5b83a-ebdb-4968-9f9a-5756c34e42dd

  2. I am not able to upload the user & catchment via CSV getting error "query did not return a unique result" .

In an implementation there are 2 groups with same name and one is voided.
In the code, we're checking for groups by name, and it seems there are two groups with the same name, causing the code to break. check here

For address levels and sync concepts in 'Users and Catchments' CSV file it is working currently even when duplicates exist with one of them only voided, since we rename the name on voiding.

Acceptance criteria:

  • Should be able to create catchment with name say ABC, if previous catchment created with same name was voided.
  • Should be able to associate an user with a existing catchment(by uploading via UsersAndCatchment csv), even if there exists 2 catchment(one voided and one not)
  • Should be able to create user group with name say 'Dev', if previous user group created with same name was voided.
  • Should be able to associate an user with a existing user group(by uploading via UsersAndCatchment csv), even if there exists 2 user groups(one voided and one not)
  • Any data migration if needed for handling the existing rows of above entities. Just comment the queries, during prod deployment it can be run.

Technical points:

  • 1st option: When voiding the above rows in DB, rename the names of the entities by appending (voided~someid) like done for concepts and other entities.
  • 2nd option: whenever we fetch to check if something is existing or when creating new entities, check only non-voided entries
  • Seems like the 1st option above is better since it will involve fixing in only one place. Else, when checking when creating entity via web app or upload via CSV(Users and Catchment), everywhere the fix need to be made. Eg: for user groups AFAIK I see we need to handle at 2 places if we go by 2nd option.
@nupoorkhandelwal nupoorkhandelwal added the bug Something isn't working label Dec 27, 2022
@vinayvenu vinayvenu moved this to New Issues in Avni Product Jun 15, 2023
@vinayvenu vinayvenu moved this from New Issues to Analysis Complete in Avni Product Jun 15, 2023
@mahalakshme
Copy link
Contributor

not a priority so moving it to 8.0

@mahalakshme mahalakshme added the good first issue Good for newcomers label Mar 21, 2024
@mahalakshme mahalakshme moved this from In Analysis Review to Analysis Complete in Avni Product Mar 21, 2024
@vedfordev
Copy link
Contributor

@mahalakshme I think it is server related card

@mahalakshme mahalakshme changed the title cannot create catchment with same name even if the first one is voided cannot create catchment/user group with same name even if the first one is voided Jul 22, 2024
@mahalakshme mahalakshme removed good first issue Good for newcomers bug Something isn't working labels Jul 22, 2024
@sachsk sachsk self-assigned this Jul 22, 2024
sachsk added a commit to avniproject/avni-server that referenced this issue Jul 22, 2024
@sachsk sachsk moved this from Analysis Complete to In Progress in Avni Product Jul 22, 2024
@mahalakshme mahalakshme moved this from In Progress to Code Review Ready in Avni Product Jul 23, 2024
himeshr added a commit to avniproject/avni-server that referenced this issue Jul 25, 2024
avniproject/avni-webapp#858 | Rename the catchment and user group if …
@himeshr himeshr moved this from Code Review Ready to QA Ready in Avni Product Jul 25, 2024
@AchalaBelokar AchalaBelokar moved this from QA Ready to In QA in Avni Product Jul 25, 2024
@AchalaBelokar AchalaBelokar moved this from In QA to QA Ready in Avni Product Jul 25, 2024
@AchalaBelokar AchalaBelokar moved this from QA Ready to In QA in Avni Product Jul 25, 2024
@AchalaBelokar
Copy link

AchalaBelokar commented Jul 25, 2024

  • created catchment with same name test in maha@APF organisation it is not allowing us to create the same name catchment. showing the Catchment with name Test already exists.
  • as mention in the video it is happening the same.
  • also I am able to create a voided group name DEv is the group name which is created by me..
    All this testing is happened on staging environment

@AchalaBelokar AchalaBelokar moved this from In QA to QA Failed in Avni Product Jul 25, 2024
@mahalakshme
Copy link
Contributor

@sachsk this is in QA failed now

@sachsk
Copy link
Member

sachsk commented Jul 27, 2024

@mahalakshme i think these changes are not deployed on the staging

@mahalakshme
Copy link
Contributor

@sachsk please discuss directly with achala. Else it might get missed.

@AchalaBelokar AchalaBelokar moved this from QA Failed to In QA in Avni Product Jul 30, 2024
@AchalaBelokar
Copy link

  • @sachsk I deployed the latest server on staging still changes is not shown on staging
Screen.Recording.2024-07-31.at.1.02.29.AM.mov

@AchalaBelokar AchalaBelokar moved this from In QA to QA Failed in Avni Product Jul 30, 2024
@sachsk
Copy link
Member

sachsk commented Jul 31, 2024

@AchalaBelokar i am able to create catchment and user group with same name on staging

Screen.Recording.2024-07-31.at.8.43.08.PM.mov
Screen.Recording.2024-07-31.at.8.44.49.PM.1.mov

@AchalaBelokar AchalaBelokar moved this from QA Failed to Done in Avni Product Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

6 participants