Skip to content

Conversation

@supervoidcoder
Copy link
Member

HGRUFIYGQegyecgyaescyigcgyuqwrcw];d41]5]23.\5[\2.]5[.1]5.[1]\26[.]346.[]\34.[6

Resolves OmniBlocks/scratch-gui#227

HGRUFIYGQegyecgyaescyigcgyuqwrcw];d41]5]23.\5[\2.]5[.1]5.[1]\26[.\]346.[]\34.[6
@coderabbitai
Copy link

coderabbitai bot commented Oct 16, 2025

Summary by CodeRabbit

  • Refactor
    • Optimized extension loading and resource management through internal code improvements.

Summary by CodeRabbit

  • Bug Fixes
    • Improved consistency in how extension URLs are resolved for sandbox initialization and worker management, ensuring more reliable extension loading.

Walkthrough

The PR fixes incorrect normalURL references by switching sandbox resolution, URL rewriting, pending extension entries, and worker URL mappings to use the correct extensionURL in the extension manager.

Changes

Cohort / File(s) Summary
Extension Manager Bug Fix
src/extension-support/extension-manager.js
Replaced normalURL references with extensionURL in loadExtensionURL. Updated sandbox resolution, rewritten URL handling, pendingExtensions entries, and workerURLs mapping to use extensionURL consistently.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related issues

Poem

🐰 A rabbit hops through extension lands,

where normalURL slipped from hurried hands.
extensionURL now lights the way,
and every extension loads today. ✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The pull request title is a random string of characters and does not summarize any change in the code. It fails to reflect the main purpose of fixing the undefined normalURL error in extension loading, making it unclear to reviewers and other developers. A meaningful, concise title is necessary for clarity in the project's history. Please update the title to a concise, descriptive sentence that highlights the main change, such as "Fix undefined normalURL error in extension loading." This will help reviewers quickly grasp the intent of the pull request. A clear title improves project documentation and maintainability.
Description Check ⚠️ Warning The pull request description contains unintelligible, random text and does not provide any insight into the code changes or their purpose. It fails to describe how the normalURL ReferenceError is addressed or what modifications were made to the extension manager. Without a clear description, reviewers cannot assess the changes effectively. Please replace the gibberish text with a clear summary of the changes, explaining how the code was updated to fix the undefined normalURL error in extension loading and describing any modifications to loadExtensionURL and pendingExtensions. A concise description will provide context for reviewers and maintainers.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues Check ✅ Passed The code changes replace all references to the undefined normalURL with extensionURL in loadExtensionURL and adjust the pendingExtensions structure accordingly, directly addressing the ReferenceError described in issue TurboWarp#227. By ensuring sandboxed and unsandboxed extension URLs no longer rely on normalURL, the pull request fulfills the primary objective of fixing extension loading errors. No other requirements from the linked issue remain unmet.
Out of Scope Changes Check ✅ Passed All modifications are focused on updating the extension-manager logic to remove undefined normalURL references and use extensionURL consistently. There are no unrelated additions or deletions outside of the scope defined by issue TurboWarp#227. The pull request does not introduce any changes beyond what is necessary to resolve the extension loading error.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-extension-not-loading

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@OmniBlocks OmniBlocks deleted a comment from devloai bot Oct 16, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/extension-support/extension-manager.js (1)

284-288: Remove commented-out code.

The commented normalization logic is no longer used and adds clutter. Since normalURL has been replaced with extensionURL throughout, this code can be safely removed.

Apply this diff to remove the obsolete code:

-       /* if (extensionURL.includes("ilelagal.site")) {
-            alert("Extensions using p*mod.site are deprecated, please swap them over to use forbiden mod.com instead.") */
-            // so um since i "borrowed" this code from antartic bird mod theres a bunch of refernces and special cases to it.. so.... i dont care. im just removiing them all
-        
-        // const normalURL = extensionURL.replace(".site", ".com");
-
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7d3a23d and 3dbc52d.

📒 Files selected for processing (1)
  • src/extension-support/extension-manager.js (3 hunks)
🔇 Additional comments (1)
src/extension-support/extension-manager.js (1)

294-295: Approve patch

Replacing normalURL with extensionURL fixes the ReferenceError and both getSandboxMode and rewriteExtensionURL accept raw URLs unchanged; no further changes required.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/extension-support/extension-manager.js (1)

347-347: Duplicate detection fix acknowledged.

The change preserves the original extensionURL in pendingExtensions, which is then stored in workerURLs at line 486. This ensures duplicate detection at line 275 works correctly for both sandboxed and unsandboxed extensions, addressing the concerns from the previous review.

The rewrittenURL property is currently unused (the worker receives the original URL via allocateWorker at line 487). If sandboxed extensions need to avoid re-fetching, consider passing the blob URL or rewrittenURL to the worker instead of the original extensionURL.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3dbc52d and a021a97.

📒 Files selected for processing (1)
  • src/extension-support/extension-manager.js (4 hunks)
🔇 Additional comments (2)
src/extension-support/extension-manager.js (2)

294-295: Critical fix: ReferenceError resolved.

Correctly using extensionURL parameter instead of the undefined normalURL variable. This directly resolves the "ReferenceError: normalURL is not defined" from issue TurboWarp#227.


319-319: Correct URL tracking for unsandboxed extensions.

The change to store extensionURL (the original URL) aligns with the duplicate detection logic at line 275 and fixes the ReferenceError for unsandboxed extensions.

@supervoidcoder supervoidcoder merged commit 6d825a0 into develop Oct 16, 2025
1 of 3 checks passed
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.

Error when loading ANY extension

2 participants