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

Exception when modifying a functional group after adding a ketcher editor subscription #5988

Open
askyel opened this issue Nov 18, 2024 · 1 comment · May be fixed by #5993
Open

Exception when modifying a functional group after adding a ketcher editor subscription #5988

askyel opened this issue Nov 18, 2024 · 1 comment · May be fixed by #5993
Assignees
Labels

Comments

@askyel
Copy link

askyel commented Nov 18, 2024

Steps to Reproduce

  1. Go to https://lifescience.opensource.epam.com/KetcherDemoSA/index.html or use ketcher v.2.25.0
  2. Execute ketcher.editor.subscribe("change", () => console.log("hello")); in the console (or add any other change subscription)
  3. In the canvas, add a functional group such as "CF3"
  4. Click on another atom such as "Br" and click on the functional group
  5. Exceptions are thrown and the canvas becomes blank

Actual behavior
After a ketcher editor subscription is added for a "change" event, trying to replace a functional group, expand a functional group, or contract a functional group causes exceptions to be thrown. In addition, the ketcher canvas becomes blank.
This is the stracktrace shown for the exception:

Uncaught TypeError: Cannot read properties of undefined (reading 'type')
    at eval (index.modern.js:17491:16)
    at Array.forEach (<anonymous>)
    at customOnChangeHandler (index.modern.js:17489:31)
    at subscribeFuncWrapper (index.modern.js:24527:22)
    at Subscription.dispatch (index.js:51:19)
    at Editor.update (index.modern.js:24463:29)
    at AtomTool.mouseup (index.modern.js:16678:14)
    at useToolIfNeeded (index.modern.js:24661:130)
    at Handler.eval [as f] (index.modern.js:24721:24)
    at DOMSubscription.dispatch (index.js:93:21)
    at HTMLDocument.eval (index.modern.js:24708:21)
    at HTMLDocument.sentryWrapped (helpers.js:106:17)

Expected behavior
The correct functional group modification on the canvas structure - in this case the "Br" atom replacing the "CF3" functional group.

Screenshots
https://github.com/user-attachments/assets/ebccc96a-eb12-4d08-88c0-c0402fb0552c
image

Desktop (please complete the following information):

  • OS: macOS
  • Browser: chrome
  • Version: 130.0.6723.117 (Official Build) (arm64)

Ketcher version
v2.25.0

@rrodionov91
Copy link
Collaborator

Hi @askyel
Thank you for highlighting this issue.
We will check it out.

askyel added a commit to inductive-bio/ketcher that referenced this issue Nov 19, 2024
@rrodionov91 rrodionov91 moved this to Code review in Ketcher Nov 19, 2024
@rrodionov91 rrodionov91 self-assigned this Nov 20, 2024
askyel added a commit to inductive-bio/ketcher that referenced this issue Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Code review
2 participants