8188 monomer library error reporting#10045
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR makes monomer library loading failures visible by converting non-KET monomer data to KET with explicit error wrapping, surfacing validation errors, and adding startup logging so async failures aren’t silently ignored.
Changes:
- Wrap struct-service conversion failures with a clearer monomer-load error message.
- Collect monomer library validation errors and throw them after attempting to update the library.
- Update macromolecules editor init to log async monomer library init failures; enable previously
test.fail’d e2e cases.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| packages/ketcher-macromolecules/src/state/common/editorSlice.ts | Logs rejected monomer-library init Promise during editor startup. |
| packages/ketcher-core/src/application/ketcher.ts | Wrapes conversion errors into a clearer monomer-load error. |
| packages/ketcher-core/src/application/editor/Editor.ts | Aggregates validation errors, logs them, and throws after update dispatch. |
| ketcher-autotests/tests/specs/Chromium-popup/Library/library-update.spec.ts | Enables e2e cases previously marked as expected failures. |
Preserve the underlying conversion error, keep monomer-library validation logging consistent, and strengthen the e2e checks so malformed inputs fail with the expected reason. Co-authored-by: Cursor <cursoragent@cursor.com>
Preserve the underlying conversion error, keep monomer-library validation logging consistent, and strengthen the e2e checks so malformed inputs fail with the expected reason. Co-authored-by: Cursor <cursoragent@cursor.com>
2e405c9 to
939b058
Compare
Co-authored-by: Cursor <cursoragent@cursor.com>
Review SummaryOverall the partial-success aggregation pattern with a custom 1.
|
Code review summaryThe PR achieves its stated goal for most validators — Inconsistency: not all validators were convertedThe new
These cases remain silent failures, which contradicts the PR's stated goal of failing loudly on malformed input. Either route them through Other inline notes
Non-blocking
|
Reject invalid groupName values before Indigo conversion so bad monomer library input fails with a visible error. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
- Add SkippedMonomerItem interface so callers get a structured { name, reason }
instead of raw log sentences from error.skippedItems
- Compute partialSuccess from real commit state instead of hardcoding true
- Strip redundant monomer name from each reason string (name is already a
separate field; log formatter prepends it automatically)
- Add TSDoc block with field descriptions and a usage example
- Update tests to assert on the new field shapes and partialSuccess values
Co-authored-by: Cursor <cursoragent@cursor.com>
Log monomer library init failures through KetcherLogger and store the error so the UI can react to partial or broken library loads. Co-authored-by: Cursor <cursoragent@cursor.com>
Clarify the thrown behavior for monomer library updates so SDK callers can handle partial updates and conversion failures correctly. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…y-error-reporting
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
- Replace test.slow() with test.setTimeout(360000) in Case 7 (3500 monomers); test.slow() only gave 180 s which is less than the 300 s already needed for Case 6 (3000 monomers) - Remove duplicate aliasBILN ternary in formatAliasDetails - Remove duplicate isValidBilnAlias check block - Remove duplicate group-template name length check block Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
- Revert Cases 23-24 back to test.fail (returns null, linked issues #8185/#8183 not yet fixed) - Promote Cases 25-27 to plain test() (our validation now correctly rejects these inputs) - Fix Cases 12-13 toContain case mismatch: 'invalid' -> 'Invalid HELM alias value' Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…y-error-reporting
…y-error-reporting
This reverts commit f883121.
…y-error-reporting
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
How the feature works? / How did you fix the issue?
This change makes monomer library loading fail loudly instead of silently when SDF input is malformed.
If
ketcher.updateMonomersLibrary()receives non-KET data, Ketcher now converts it to KET insideensureMonomersLibraryDataInKetFormat(). If the conversion fails, the error is wrapped with a clearer message:Monomer item could not be loaded because of an error: ...That error now propagates to the caller and is also logged to the console, so broken monomer presets are no longer ignored without feedback.
I also added a console catch in macromolecules editor initialization so async monomer library loading failures are not lost at startup.
Added an e2e test for the broken SDF case from the issue to verify the error is thrown and the preset is not added to the library.
Check list
#1234 – issue name#