mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #2417] [MERGED] Disable imported extensions so profile import never auto-runs their JS #5593
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#5593
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2417
Author: @Romuromylus
Created: 6/6/2026
Status: ✅ Merged
Merged: 6/6/2026
Merged by: @Romuromylus
Base:
refactor← Head:fix/profile-import-extensions-disabled📝 Commits (1)
6003aceDisable imported extensions so profile import never auto-runs their JS📊 Changes
2 files changed (+18 additions, -0 deletions)
View changed files
📝
src-tauri/src/commands/storage/profile.rs(+17 -0)📝
src-tauri/src/commands/storage/profile/legacy.rs(+1 -0)📄 Description
Linked issue
Closes #2366
Why this change
extensionsrows verbatim, so an exported extension carryingenabled: true(with arbitrary JS) was restored enabled.CustomThemeInjectorthen executed that imported JavaScript on the next render with no user opt-in — arbitrary-JS auto-run on import. (#2382 only sanitized theme/extension CSS; theenabled: truepassthrough was untouched.)What changed
src-tauri/src/commands/storage/profile.rs: addeddisable_imported_extension_rows, apub(super)helper that forces every imported extension row'senabledtofalse, and call it inprofile_collections_import_planfor theextensionscollection (mirrors the connection-secret redaction special-case in the same loop). The JS/CSS payload and all other fields are preserved — onlyenabledis overwritten.src-tauri/src/commands/storage/profile/legacy.rs: the legacy SQLite/fileStorage import path gets the sameextensionsarm viasuper::disable_imported_extension_rows, so both import plans stay consistent.Refactor impact
Primary owner: Rust storage (imports)
Impact areas reviewed:
src-tauri/src/commands/storage/profile.rs(profile_collections_import_plan+ new helper)src-tauri/src/commands/storage/profile/legacy.rs(legacy import per-collection match)Boundary notes:
EMPTY_DEFAULTS— the gate belongs in the import path). No TS touched.Pressure points touched:
profile.rs,profile/legacy.rs).Validation
pnpm checkpasses before PR push/handoffManual verification notes
cargo test --manifest-path src-tauri/Cargo.toml -p marinara-engine(profile import) — a local-only test confirmed an imported extension carryingenabled: truecomes backenabled: falsewith itsjspayload preserved.cargo clippy --manifest-path src-tauri/Cargo.toml --workspace --all-targets -- -D warnings— clean.Feature Discoverability
src/features/shell/discovery/Reason:
Docs and release impact
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.