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

Duplicate concept answers breaks concepts page #1060

Closed
Tracked by #1557 ...
mahalakshme opened this issue Oct 11, 2023 · 17 comments
Closed
Tracked by #1557 ...

Duplicate concept answers breaks concepts page #1060

mahalakshme opened this issue Oct 11, 2023 · 17 comments
Assignees
Labels

Comments

@mahalakshme
Copy link
Contributor

mahalakshme commented Oct 11, 2023

Need:

Some coded concepts have more than 15 answers and all are added at the same time. Hence the user sometimes by mistake adds the same concept answer twice. When it doesn't show a valid error, it is raised as a ticket.

Current scenario:

env: staging, prod

Expected:

  • Show error 'Duplicate answer specified' on-clicking "Save" button and Oops error page should not display.
  • Also handle the above when creating concepts directly in form. (InlineConcept)
  • Removal of duplicate answer of previously existing answer concept should not result in voiding of earlier answer
  • All duplicates except the first original answer should have duplicate error msg shown
  • All different duplicates should be shown as errors at once

Old: ignore

Expected:

  • Whenever duplicate concept answers are added show valid error message stating 'Duplicate answer present. Remove them to proceed.' like in the mockup below, below the last duplicate instead of showing Oops error page.

Image

@mahalakshme mahalakshme converted this from a draft issue Oct 11, 2023
@mahalakshme mahalakshme added bug Something isn't working user reported labels Oct 11, 2023
@mahalakshme mahalakshme moved this from In Analysis to In Analysis Review in Avni Product Oct 11, 2023
@mahalakshme
Copy link
Contributor Author

mahalakshme commented Oct 11, 2023

concept page breaks. Added it to 5.1.0 since was raised by Vedant once, came as ticket and multiple discussions. To reduce the tickets added it to 5.1.0.

@mahalakshme mahalakshme changed the title Duplicate concept answers breaks webapp Duplicate concept answers breaks concepts page Oct 11, 2023
@mahalakshme mahalakshme changed the title Duplicate concept answers breaks concepts page Invalid concept answers breaks concepts page Oct 11, 2023
@vinayvenu vinayvenu moved this from In Analysis Review to Analysis Complete in Avni Product Oct 11, 2023
@arjunk
Copy link
Contributor

arjunk commented Oct 11, 2023

I see in the database we have concepts with '&' and various other special characters also.

check using the following queries
select * from concept where name ~* '[^a-z0-9 ]' order by created_date_time desc; (last created till July)
select * from concept where name like '%&%'

What special characters are currently being supported/not supported? What is the basis of this? This change seems to have been done in the last few releases but couldn't find any relevant issue except this avniproject/avni-server#449 or release notes (Haven't checked code)
For the concepts where such names with special characters are already there, what problem is it or will it be causing? Do we need to migrate them?
Apart from giving an informative error message to the user, we need to document this.

@vinayvenu
Copy link
Member

@mahalakshme I think I read the acceptance criteria wrong. Is there a need to remove these characters from concept answers?

@vinayvenu vinayvenu moved this from Analysis Complete to In Analysis in Avni Product Oct 12, 2023
@mahalakshme
Copy link
Contributor Author

@vinayvenu @arjunk I think as part of security fixes, this change might have occured. But special characters are not allowed even after turning off enhanced validations in prod. We will need to check what has caused this change.

@mahalakshme
Copy link
Contributor Author

moved the character issue to separate card: #1058

@mahalakshme mahalakshme changed the title Invalid concept answers breaks concepts page Duplicate concept answers breaks concepts page Oct 19, 2023
@mahalakshme mahalakshme moved this from In Analysis to In Analysis Review in Avni Product Oct 19, 2023
@mahalakshme mahalakshme moved this from In Analysis Review to In Analysis in Avni Product Oct 19, 2023
@mahalakshme mahalakshme moved this from In Analysis to In Analysis Review in Avni Product Oct 19, 2023
@mahalakshme mahalakshme moved this from In Analysis Review to Focus Items in Avni Product Oct 30, 2023
@mahalakshme mahalakshme removed the bug Something isn't working label Mar 29, 2024
@mahalakshme mahalakshme moved this from Focus Items to In Analysis Review in Avni Product Mar 29, 2024
@mahalakshme mahalakshme added the good first issue Good for newcomers label Mar 29, 2024
@vinayvenu
Copy link
Member

Mockups - we can show the duplicates if possible?

himeshr added a commit that referenced this issue Aug 28, 2024
@himeshr
Copy link
Contributor

himeshr commented Aug 28, 2024

Sample Duplicate answer screenshots

Screenshot 2024-08-28 at 1 11 07 PM Screenshot 2024-08-28 at 1 16 42 PM

@himeshr himeshr moved this from In Progress to Code Review Ready in Avni Product Aug 28, 2024
@petmongrels petmongrels moved this from In Code Review to QA Ready in Avni Product Aug 30, 2024
@AchalaBelokar
Copy link

@himeshr I created a concept with ASH and ash it is accepting the value not showing the error. is it valid or not.?

@himeshr
Copy link
Contributor

himeshr commented Oct 25, 2024

@himeshr I created a concept with ASH and ash it is accepting the value not showing the error. is it valid or not.?

@AchalaBelokar, In Avni, Concept names are case-sensitive, we allow users to create concepts with same name but with different case, which are used in different forms.. this is pretty common.

Now for Concept Answers, the only usecase i can think of, where concept answers with same name but different case might be needed, is when there is an external integration system, which accepts different case answers in different conditions.

So i would say that in principle, we should not error in-case there is more than 1 concept-answer with same name but different case.

@mahalakshme pls confirm if the duplicates check should ignore case and trailing whitespaces.

@mahalakshme
Copy link
Contributor Author

@himeshr I will think and update

@mahalakshme mahalakshme moved this from In QA to Hold in Avni Product Oct 25, 2024
@mahalakshme
Copy link
Contributor Author

@AchalaBelokar it does make sense to make the concepts to be considered duplicate independent of the case, but considering we have allowed it so far, it is now complex to correct the existing data. So we need not fix it as part of 10.1.0, will add it to a different release.

@mahalakshme mahalakshme moved this from Hold to Ready in Avni Product Oct 30, 2024
@dinesh2096
Copy link

  • When we removed the option and try to add the same option in the concept it is still showing a error and also if we move the option and select the option and clicking on the save the error is removed but the save is not happening.

QA Reference video :

Click here to watch the video

@dinesh2096 dinesh2096 moved this from In QA to QA Failed in Avni Product Nov 1, 2024
@himeshr himeshr moved this from QA Failed to Code Review Ready in Avni Product Nov 4, 2024
@himeshr
Copy link
Contributor

himeshr commented Nov 4, 2024

Handled additional test-cases:

  • Recreation of previously saved voided concept answer
  • Handling removal of duplicate non-voided answers when previously saved non-voided concept answer

himeshr added a commit that referenced this issue Nov 4, 2024
@petmongrels
Copy link
Contributor

We don't have any check on server for duplicate concepts. we should add a database constraint.

@petmongrels petmongrels moved this from In Code Review to Code Review with Comments in Avni Product Nov 5, 2024
@himeshr himeshr moved this from Code Review with Comments to In Progress in Avni Product Nov 5, 2024
@himeshr
Copy link
Contributor

himeshr commented Nov 5, 2024

Screenshot 2024-11-05 at 2 47 16 PM

We don't have any check on server for duplicate concepts. we should add a database constraint.

We do have it, checked in code as well as on local and prod openchs Databases for Concept table.

@himeshr
Copy link
Contributor

himeshr commented Nov 5, 2024

Constraint also exists on DB for concept_answer..
Screenshot 2024-11-05 at 2 52 06 PM

@himeshr himeshr moved this from In Progress to QA Ready in Avni Product Nov 5, 2024
@dinesh2096
Copy link

QA Reference :

Click here to watch video

@dinesh2096 dinesh2096 self-assigned this Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

7 participants