Skip to content

Preserve JavaScript fallback across provider linkage failures - #390

Open
BenCodez wants to merge 1 commit into
masterfrom
fix/javascript-provider-linkage-20261125
Open

BenCodez wants to merge 1 commit into
masterfrom
fix/javascript-provider-linkage-20261125

Conversation

@BenCodez

@BenCodez BenCodez commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

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.

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

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.

Changes: JavaScript Engine Handling

Layer / File(s) Summary
Downloaded provider loading
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 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.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: codex

Merge Risk: Minimal · up to 93d4b

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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed 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.

Share

@BenCodez
BenCodez marked this pull request as ready for review November 25, 2026 02:09
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T02:10:59.211829Z 93d4b37 Draft marked ready
🔒 Security Review ✅ Completed 2026-11-25T02:12:14.464427Z 93d4b37 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants