epam / ketcher

Web-based molecule sketcher
https://lifescience.opensource.epam.com/ketcher/demo.html
Apache License 2.0
441 stars 158 forks source link

It is possible to create forbidden RNA preset #4763

Closed AlexeyGirin closed 13 hours ago

AlexeyGirin commented 1 month ago

Steps to Reproduce

  1. Open RNA builder
  2. Click New Preset button
  3. Select Phosphate (P in my case)
  4. Select Base (A in my case)
  5. Select 3SS6 sugar image
  6. Press Add to Presets button

Actual behavior Preset is created image

Expected behavior Corresponding error should be shown in a pop-up error box and 'Save'/'Add to presets' button should be disabled Since 3SS6 sugar don't have R3 attachment point RNA preset is forbidden due to requirements:

Sugar without R3 connection point cannot make this nucleotide If user validation rule is violated corresponding error should be shown in a pop-up error box and 'Save'/'Add to presets' button should be disabled

Versions:

Issue found while testing https://github.com/epam/ketcher/issues/3816

DmitriiP-EPAM commented 3 weeks ago

@AlexeyGirin believes that the problem may concern not only sugars, but also RNA bases and phosphates, however, such cases cannot be verified due to the fact that there is no phosphate without an R1 bond and there is no RNA base without an R1 bond.

I believe that at the code level the problem is due to an incorrect state update that selectGroupItemValidations receives.