epam / ketcher

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

Micro: No max length limit for atom custom query feature cause exception if content size too big #3842

Open AlexeyGirin opened 11 months ago

AlexeyGirin commented 11 months ago

Steps to Reproduce

  1. Load molecule from file: CustomQueryFeatureToBig.zip (unzip first)
  2. Select all ring and press Copy to clipboard button (Ctrl+C) Alternative way:
  3. Create custom query feature for any atom with VERY LARGE content

Actual behavior System throws exception to log: nightly.test.lifescience.opensource.epam.com-1704454758359.log

image

Expected behavior

  1. System doesn't allow to create so large query feature and limit on that field is set to 4000 chars Real example from Examples SMARTS.txt: [$([O,S,#7;R1;r9,r10,r11,r12,r13,r14,r15,r16,r17,r18][CH,CH2;r9,r10,r11,r12,r13,r14,r15,r16,r17,r18][CH,CH2;r9,r10,r11,r12,r13,r14,r15,r16,r17,r18][O,S,#7;R1;r9,r10,r11,r12,r13,r14,r15,r16,r17,r18][CH,CH2;r9,r10,r11,r12,r13,r14,r15,r16,r17,r18][CH,CH2;r9,r10,r11,r12,r13,r14,r15,r16,r17,r18][O,S,#7;R1;r9,r10,r11,r12,r13,r14,r15,r16,r17,r18]),$([O,S,#7;R1;r9,r10,r11,r12,r13,r14,r15,r16,r17,r18][CH,CH2;r9,r10,r11,r12,r13,r14,r15,r16,r17,r18][CH,CH2;r9,r10,r11,r12,r13,r14,r15,r16,r17,r18][CH,CH2;r9,r10,r11,r12,r13,r14,r15,r16,r17,r18][O,S,#7;R1;r9,r10,r11,r12,r13,r14,r15,r16,r17,r18][CH,CH2;r9,r10,r11,r12,r13,r14,r15,r16,r17,r18][CH,CH2;r9,r10,r11,r12,r13,r14,r15,r16,r17,r18][CH,CH2;r9,r10,r11,r12,r13,r14,r15,r16,r17,r18][O,S,#7;R1;r9,r10,r11,r12,r13,r14,r15,r16,r17,r18]),$([O,S,#7;R1;r9,r10,r11,r12,r13,r14,r15,r16,r17,r18][CH,CH2;r9,r10,r11,r12,r13,r14,r15,r16,r17,r18][CH,CH2;r9,r10,r11,r12,r13,r14,r15,r16,r17,r18][O,S,#7;R1;r9,r10,r11,r12,r13,r14,r15,r16,r17,r18][CH,CH2;r9,r10,r11,r12,r13,r14,r15,r16,r17,r18][CH,CH2;r9,r10,r11,r12,r13,r14,r15,r16,r17,r18][CH,CH2;r9,r10,r11,r12,r13,r14,r15,r16,r17,r18][O,S,#7;R1;r9,r10,r11,r12,r13,r14,r15,r16,r17,r18])] - 1168 chars
  2. System doesn't allow to save so large content to file - error should occur
  3. System doesn't allow to load so large content from file - error should occur

Issue found while testing https://github.com/epam/Indigo/issues/1446

Desktop (please complete the following information):

Ketcher version [e.g. v2.4.2]. Ketcher Version 2.15.0-rc.4 Build at 2023-10-25; 14:15:43 Indigo Toolkit Version 1.18.0-dev.2.0-g369c82f8c-x86_64-linux-gnu-11.4.0

AlexeyGirin commented 10 months ago

Investigate in base of SMARTS db for MAX SMART