You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Preserve JavaScript fallback across provider linkage failures - #390
A malformed factory class inside an otherwise readable optional Nashorn archive could throw a linkage error before preparation reached the fallback. Handle provider linkage failures while the candidate loader is still unpublished, preserving the previous loader until a replacement is ready.
Keep engine metadata diagnostics separate from successful publication. A metadata linkage failure now leaves the published engine available. Regressions check the public preparation result, cached/prepared state, prior and replacement loader lifetimes, and malformed-class fallback.
Validation: Java 21; 26 focused JavaScript tests; fresh package with 1,780 ordinary tests and 2 artifact tests passing.
Downstream integration validation remains pending; source review and CI validation are complete.
Summary by CodeRabbit
Bug Fixes
Improved handling of missing or incompatible JavaScript engine components. Engine loading now reports the engine as unavailable when initialization fails, while diagnostic failures no longer disrupt an engine that is already available.
Preserved the previously installed engine loader when an optional provider cannot be loaded.
No actionable comments were generated in the recent review.
Walkthrough
The JavaScript engine handler now catches LinkageError during downloaded engine loading and engine metadata inspection. Tests cover malformed optional providers and metadata failures after an engine has been published.
The handler catches LinkageError while loading or invoking a downloaded provider and returns null. Tests verify that a malformed provider does not replace or close the previous loader.
Published engine diagnostics AdvancedCore/src/main/java/com/bencodez/advancedcore/api/javascript/JavascriptEngineHandler.java, AdvancedCore/src/test/java/com/bencodez/advancedcore/tests/javascript/JavascriptLoaderOwnershipTest.java
The handler catches LinkageError when reading engine details. Tests verify that a metadata failure leaves the published engine prepared and available, with version 15.7, without requiring the 15.4 fallback.
This change makes the JavaScript engine fall back more gracefully when an optional provider or engine metadata fails to link. The previously loaded engine stays available. No concrete merge-blocking risk was identified, though downstream integration validation is still pending.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "Preserve JavaScript fallback across provider linkage failures" matches the main change. The summary shows catching LinkageError in getDownloadedEngine and logEngine, and the tests cover a m…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check
Explanation
The title "Preserve JavaScript fallback across provider linkage failures" matches the main change. The summary shows catching LinkageError in getDownloadedEngine and logEngine, and the tests cover a malformed Nashorn provider keeping the previous loader. The objectives say the PR preserves the previous loader when a replacement fails to link, which the title describes.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment "@codex review" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A malformed factory class inside an otherwise readable optional Nashorn archive could throw a linkage error before preparation reached the fallback. Handle provider linkage failures while the candidate loader is still unpublished, preserving the previous loader until a replacement is ready.
Keep engine metadata diagnostics separate from successful publication. A metadata linkage failure now leaves the published engine available. Regressions check the public preparation result, cached/prepared state, prior and replacement loader lifetimes, and malformed-class fallback.
Validation: Java 21; 26 focused JavaScript tests; fresh package with 1,780 ordinary tests and 2 artifact tests passing.
Downstream integration validation remains pending; source review and CI validation are complete.
Summary by CodeRabbit